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 nc -l 8989 < <(FILE=my_image.gif; echo -e "HTTP/1.1 200 OK\nContent-type: $(file -nb --mime-type $FILE)\n"; cat $FILE); 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
| javascript:s=document.body.style;void(s.fontFamily='ubuntu light, lucida grande, verdana' );void(s.background='#EEEEEE');void(s.color='black');void(function(){for(i=0;i<document.links.length;i++){document.links[i].style.color='blue'}}()); |
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
| unset xs; declare -a xs; xs=(${xs[@]} 11); xs=(${xs[@]} 23); echo length: ${#xs[@]}; for n in ${xs[@]}; do echo $n; 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
| # Mutt aliases, one for each imap account | |
| for conf in ~/.mutt/imap_* | |
| do | |
| alias mutt_${conf#*imap_}="mutt -e 'source $conf'" | |
| 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
| ## | |
| ## IMAP CREDENTIALS | |
| ## | |
| set smtp_url = "smtp://some_user@smtp.gmail.com:587/" | |
| #set smtp_pass = "password" | |
| set from = "someuser@example.com" | |
| set realname = "Some User" | |
| ## | |
| ## IMAP SETTINGS |
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
| // Lives at: https://gist.github.com/3103615/ | |
| function cartesianProduct(xss) { | |
| if (!xss || xss.length < 1) | |
| return []; | |
| else { | |
| var head = xss[0]; | |
| var tail = xss.slice(1); | |
| var result = []; | |
| for (var i = 0; i < head.length; i++) { | |
| var productOfTail = cartesianProduct(tail); |
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
| # Create svg graph file | |
| cat plotdata_raw | gnuplot -e "set terminal svg; plot '-' using 2:1 with lines" > my_graph.svg | |
| # where plotdata_raw is a file with data, 2 columns separated by whitespace. | |
| # using 2:1 means: use column 2 as x, column 1 as y axis | |
| # with lines: draw a line graph | |
| # Parse time | |
| cat plotdata_raw | gnuplot -e "set xdata time; set timefmt '%s'; plot '-' using 2:1 with lines" -p |
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
| require 'webrick' | |
| require 'erb' | |
| template = <<TEMPLATE | |
| <html> | |
| <head> | |
| <title>Ruby as PHP</title> | |
| </head> | |
| <body> | |
| <h1>Loop</h1> |
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
| #!/usr/bin/ruby | |
| require 'cgi' | |
| require 'erb' | |
| cgi = CGI.new('html') | |
| template = <<TEMPLATE | |
| <html> | |
| <head> |