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
12:40 $ pbinspect | |
0000000 < s c r i p t s r c = " h t t | |
00000000 3c 73 63 72 69 70 74 20 73 72 63 3d 22 68 74 74 |<script src="htt| | |
0000010 p s : / / g i s t . g i t h u b | |
00000010 70 73 3a 2f 2f 67 69 73 74 2e 67 69 74 68 75 62 |ps://gist.github| | |
0000020 . c o m / i p 2 k / 6 3 3 c 5 4 | |
00000020 2e 63 6f 6d 2f 69 70 32 6b 2f 36 33 33 63 35 34 |.com/ip2k/633c54| | |
0000030 a e 4 2 c e 0 0 d 9 9 5 d 0 . j | |
00000030 61 65 34 32 63 65 30 30 64 39 39 35 64 30 2e 6a |ae42ce00d995d0.j| | |
0000040 s " > < / s c r i p t > |
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
alias pbinspect='pbpaste |hexdump -cC' |
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
#!/bin/bash | |
echo "wut" |
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 'nokogiri' | |
require 'pp' | |
require 'open-uri' | |
require 'sqlite3' | |
# set our filename and path names up | |
DBNAME = 'favdb.sqlite' # filename for SQLite DB |
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
require 'sinatra' | |
require 'geoip' | |
geo = GeoIP.new('GeoLiteCity.dat') | |
get '/' do | |
begin | |
x = geo.country request.ip | |
puts x.inspect | |
unless x[:postal_code].empty? | |
"ZIP for #{request.ip}: #{x[:postal_code]}" |
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 'yaml' | |
hashy = Hash["a" => 100, "b" => 200] | |
puts hashy.inspect | |
YAML::dump(hashy, File.open('test.yaml', 'w')) | |
puts YAML::load_file('test.yaml') # attempt 1 | |
File.open( 'test.yaml' ) { |yf| puts YAML::load( yf ) } # attempt 2 |
NewerOlder