Skip to content

Instantly share code, notes, and snippets.

View brettchalupa's full-sized avatar

Brett Chalupa brettchalupa

View GitHub Profile
@brettchalupa
brettchalupa / Makefile
Created October 20, 2012 02:04
Makefile for compiling AS3 into SWFs.
MXMLC = ~/../../Library/flex_sdk_4.6.0.23201B/bin/mxmlc
SRC = src/
MAIN = src/Main.as
SWF = bin/file_name.swf
$(SWF) : $(SRC)
$(MXMLC) -o $(SWF) -static-link-runtime-shared-libraries -- $(MAIN)
run : $(SWF)
open $(SWF)
@brettchalupa
brettchalupa / output_users.rb
Created October 15, 2012 15:53
Write BMO users to a txt file.
@users = User.all
File.open("user_list.txt", "w") do |file|
@users.each do |user|
file << user.id
file << " "
file << user.name
file << "\n"
end
end
@brettchalupa
brettchalupa / bdb.haml
Created October 12, 2012 15:36
Pulling in the bday bash game.
%iframe#gameframe{:frameborder => "no", :height => "540", :onload => "this.contentWindow.focus();", :scrolling => "no", :src => "http://azurenimbus.com/aetherarcade/index.html", :style => "padding:0;margin:0;border:1px;", :width => "640"}
@brettchalupa
brettchalupa / http_write.rb
Created October 11, 2012 22:00
Write an HTTParty GET request to a file.
File.open( "/tmp/my_movie.mov", "w") do |movie|
movie << HTTParty.get( "http://example.com/movie.mov" )
end
@brettchalupa
brettchalupa / favorite_sort.rb
Created September 19, 2012 22:18
Sorting and displaying Submissions and their Favorite count
@submissions = Submission.all.sort_by { |s| s.favorites.count }
File.open("favorites_list.txt", "w") do |file|
@submissions.each do |submission|
file << submission.name + " - Favorites: " + submission.favorites.count.to_s + "\n"
end
end