This file contains 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
run ->(env) { | |
[ 200, { 'Content-Type' => 'text/plain' }, [ "Hello World" ] ] | |
} |
This file contains 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
" A simplified vimrc | |
" Full version available here: | |
" https://github.com/stevenocchipinti/dotvim/blob/master/vimrc | |
" Use Vundle to manage plugins | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() |
This file contains 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 PS1="\$(osascript -e 'set Volume 10' && say 'jerk')$PS1" |
This file contains 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
`ifconfig`.split(/^(?=\w)/).flat_map{|x| x.scan(/^(\w+).*inet ([0-9.]+)/m)} | |
#=> [["lo0", "127.0.0.1"], ["en0", "10.112.202.44"], ["vboxnet0", "192.168.59.3"], ["en4", "10.112.197.80"]] |
This file contains 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
(function(d, script) { | |
script = d.createElement('script'); | |
script.type = 'text/javascript'; | |
script.async = true; | |
script.onload = function(){ | |
// remote script has loaded | |
}; | |
script.src = '//hi.kickassapp.com/kickass.js'; | |
d.getElementsByTagName('head')[0].appendChild(script); | |
}(document)); |
This file contains 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
# rss_to_ical.rb | |
# | |
# This parses a (specific) rss feed for dates that could be used to form an ical | |
require 'nokogiri' | |
require 'open-uri' | |
require 'time' | |
# Configuration | |
url = "http://melbournepatterns.org/feed/" |
This file contains 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
# | |
# ERB | |
# | |
# <% years = (Date.today.year..Date.today.year + 12).collect %> | |
# <%= f.select( | |
# 'ccexpy', | |
# years.zip(years.collect {|y| y.to_s[-2,2]}), | |
# {}, | |
# { :class => "expirydate" } | |
# ) %> |
This file contains 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
p = open('/dev/port', 'w') | |
p.sync = true | |
sequence = [ | |
0b00000000, | |
0b00000010, 0b00001010, 0b00101010, | |
0b10101010, | |
0b00101010, 0b00001010, 0b00000010, | |
0b00000000, | |
0b00000001, 0b00000101, 0b00010101, |
This file contains 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/env ruby | |
require 'open-uri' | |
unless ARGV[0] | |
puts "Usage: #{$0} <stop-id>" | |
exit 0 | |
end | |
# Configuration | |
url = "http://www.tramtracker.com.au/?id=#{ARGV[0]}" |
This file contains 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
<html> | |
<head> | |
<title>Nested HTML list browser corrections example</title> | |
</head> | |
<body> | |
<!-- | |
This page shows that the browser will correct nested <li> elements to be |
OlderNewer