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
// 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
: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
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
(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
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
#!/bin/bash | |
if [ "$1" = '-r' ] | |
then | |
dialog --clear --yesno 'Do you realy want to remove crontab?' 5 45 || exit | |
fi | |
/usr/bin/crontab $@ |
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
_ex_.backtrace[0].tap { |v| s = v.split(':'); `gvim --remote-tab +#{s[1]} #{s[0]}` } |
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/bash | |
# Updates rbenv and it's plugins to latest versions | |
rbenv_path="$HOME/.rbenv" | |
plugins_path="$rbenv_path/plugins" | |
echo -e "\033[1;32mUpdating rbenv\033[0m" | |
cd "$rbenv_path" | |
git pull | |
for plugin in $(ls "$plugins_path"); do |
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
class Product < ActiveRecord::Base | |
attr_accessor :publisher | |
# ... | |
before_save { publisher.try(:broadcast, :before_save self) } | |
end | |