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
| while true; do git pull && notify-send 'It works again!' && break; sleep 5s; done |
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
| (ls ~ & echo $! > /tmp/pid) | grep 'text'; cat /tmp/pid |
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
| convert source.png -resize 128x128 -normalize -equalize -posterize 4 -colors 8 -unique-colors -scale 1000% colors.png |
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
| :sav %.coffee | bd# | !rm # |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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
| #!/bin/sh | |
| while :; do nc -l 9292 <<< $'HTTP/1.1 200 OK\r\nHello, world!'; done |
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
| # List of available dates you can see at https://static.rust-lang.org/dist/ | |
| curl -s https://static.rust-lang.org/rustup.sh | sudo sh -s -- --date="2015-03-25" |
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
| input_array = [1, 2, 1, 4, 1.0, 1r] | |
| require 'set' | |
| Set.new(input_array).to_a | |
| # => [1, 2, 4, 1.0, (1/1)] | |
| unique_elements = [] | |
| input_array.each { |el| unique_elements << el unless unique_elements.include?(el) } | |
| unique_elements | |
| # => [1, 2, 4] |
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
| public.class_eval { def say_hello; 'Hello!'; end } | |
| :ruby.say_hello # => "Hello!" |
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
| Object.class_eval { def self.private; Object; end } | |
| def MyClass | |
| private | |
| def some_method | |
| end | |
| end | |
| MyClass.private_instance_methods.include? :some_method # => false |