Skip to content

Instantly share code, notes, and snippets.

View sikachu's full-sized avatar

Prem Sichanugrist sikachu

View GitHub Profile
@sikachu
sikachu / gist:bd57194442b01c9b143d
Last active July 9, 2017 18:26
Pretty print PlayStation Store listing
require "open-uri"
require "json"
API_URL = "https://store.playstation.com/chihiro-api/viewfinder/US/en/19/STORE-MSF77008-SUMMERSALEPSVGG?size=100&gkb=1&geoCountry=US"
STORE_URL = "https://store.playstation.com/#!/en-us/cid=%s"
data = JSON.parse(open(API_URL).read)
games = []
data["links"].each do |game|
@lopopolo
lopopolo / gist:9427762
Created March 8, 2014 09:19
Relink all homebrew formulae after Mavericks upgrade
▶ brew list -1 | while read line; do brew unlink $line; brew link $line; done
Unlinking /usr/local/Cellar/appledoc/2.2... 0 links removed
Linking /usr/local/Cellar/appledoc/2.2... 1 symlinks created
Unlinking /usr/local/Cellar/autoconf/2.69... 0 links removed
Linking /usr/local/Cellar/autoconf/2.69... 18 symlinks created
Unlinking /usr/local/Cellar/bash-completion/1.3... 184 links removed
Linking /usr/local/Cellar/bash-completion/1.3... 182 symlinks created
Unlinking /usr/local/Cellar/bgrep/0.2... 0 links removed
Linking /usr/local/Cellar/bgrep/0.2... 1 symlinks created
Unlinking /usr/local/Cellar/binutils/2.24... 49 links removed
@sikachu
sikachu / down_wwdc_2012.rb
Created June 11, 2012 20:47
Download "WWDC 2012" from apple. http://events.apple.com.edgesuite.net/126pihbedvcoihbefvbhjkbvsefbg/event/index.html This script is based on previous Apple Special Event download script: https://gist.github.com/1997591
#!/usr/bin/env ruby
require 'open-uri'
size_hash = {"720p" => "6540", "720i" => "4540", "540p" => "2540", "540i" => "1840", "360p" => "1240", "360i" => "0640", "360is" => "0440", "224p" => "0240"}
if ["--help", "help", "-h"].include?(ARGV[0]) || ARGV.size < 1
puts "Usage: #{File.basename __FILE__} ( #{size_hash.keys.join(' | ')} )"
exit 0
end
@venj
venj / down_celebrating_steve.rb
Created October 24, 2011 02:22
Download "A Celebration of Steve's Life" from apple. http://events.apple.com.edgesuite.net/10oiuhfvojb23/event/index.html This script is based on previous WWDC keynote download script: https://gist.github.com/1012426
#!/usr/bin/env ruby
require 'open-uri'
if ["--help", "help", "-h"].include?(ARGV[0]) || ARGV.size < 1
puts "Usage: #{File.basename __FILE__} ( 540p | 540i | 360p | 360i | 360is | 224p )"
exit 0
end
size_hash = {"540p" => "2540", "540i" => "1840", "360p" => "1240", "360i" => "0640", "360is" => "0440", "224p" => "0240"}
video_size = size_hash[ARGV[0]]