- Twitter: @leifg
- Website or Blog: http://leifg.ghost.io
- Propertybase GmbH. http://propertybase.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| arr = [] | |
| # You probably know this one: | |
| #http://ruby-doc.org/core-2.0.0/Array.html#method-i-empty-3F | |
| if arr.empty? | |
| # do something | |
| end | |
| # But do you also know the opposite? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| file_to_disk = './tmp/large_disk.vdi' | |
| Vagrant::Config.run do |config| | |
| config.vm.box = 'base' | |
| config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024] | |
| config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [~]$ ruby refinements.rb | |
| refinements.rb:2: warning: Refinements are experimental, and the behavior may change in future versions of Ruby! | |
| refinements.rb:10:in `<class:MyTestClass>': undefined method `using' for MyTestClass:Class (NoMethodError) | |
| from refinements.rb:9:in `<main>' |
This is an example of adding Jenkins build status to a [dashing-dashboard](https://github.com/Shopify/dashing
If a job is running, the widget will have a grey background. If a job succeeded at its last run, it will have a green background. If a job failed at its last run, it will have a red background.
Requirements:
- Ruby 1.9
- dashing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -H 'Authorization: Bearer $ADN_TOKEN' \ | |
| -d '{"machine_only":true,"annotations":[{"type":"bla","value":"blub"}]}' \ | |
| https://alpha-api.app.net/stream/0/posts | |
| ---> | |
| { | |
| "meta": { | |
| "code": 400, | |
| "error_id": "b56ff451b98446ef803ac48325d5bb17$5f7e8eac12afb013ab7205b2ec9aaecc", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -H 'Authorization: Bearer $ADN_TOKEN' \ | |
| -F 'machine_only=true' \ | |
| https://alpha-api.app.net/stream/0/posts | |
| --> | |
| { | |
| "meta": { | |
| "code": 400, | |
| "error_id": "54b71169b64e46e2b4586f71b0f72779$5f7e8eac12afb013ab7205b2ec9aaecc", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [~]$ RBENV_DEBUG=1 bundle | |
| + '[' -z /Users/leifg/.rbenv ']' | |
| + RBENV_ROOT=/Users/leifg/.rbenv | |
| + export RBENV_ROOT | |
| + '[' -z '' ']' | |
| ++ pwd | |
| + RBENV_DIR=/Users/leifg | |
| + export RBENV_DIR | |
| + shopt -s nullglob | |
| ++ abs_dirname /usr/local/bin/rbenv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export VGNAME=ubuntu-10-04-i386 | |
| export SIZE=50G | |
| sudo vgdisplay | |
| sudo vgextend $VGNAME /dev/sdb | |
| sudo lvresize -L +$SIZE /dev/$VGNAME/root | |
| sudo resize2fs -p /dev/$VGNAME/root | |
| df -h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- should always be on top --> | |
| <div class="wrapper"> | |
| <div class="overlay"> | |
| overlay | |
| </div> | |
| </div> | |
| <!-- should always be in the back --> | |
| <div class="main"> | |
| main |