Skip to content

Instantly share code, notes, and snippets.

View whatupdave's full-sized avatar

Dave Newman whatupdave

  • Twitter
  • Seattle, WA
View GitHub Profile
@whatupdave
whatupdave / Rakefile.rb
Created May 22, 2011 12:15
Rakefile to build and publish to testflight with wox
Wox::Tasks.create :info_plist => 'assets/Info.plist' do
build :release, :configuration => 'Release', :developer_certificate => 'iPhone Developer' do
ipa :adhoc, :provisioning_profile => 'Team Provisioning Profile' do
testflight :publish, :api_token => 'PUT_YOUR_API_TOKEN_HERE',
:team_token => 'PUT_YOUR_TEAM_TOKEN_HERE',
:notes => proc { File.read("CHANGELOG") },
:distribution_lists => %w[Internal],
:notify => true
end
@whatupdave
whatupdave / Rakefile.rb
Created May 22, 2011 12:11
Rakefile for spritesheet creation
SPRITESHEETS = File.expand_path "spritesheets" # This is where the source images are
# Extracts some useful information from the full_path
def path_info base_path, full_path
relative = full_path.gsub "#{base_path}/", ""
{
full_path: full_path,
relative_path: relative,
filename: File.basename(relative)
}
@whatupdave
whatupdave / index.html
Created December 17, 2010 01:37
Builds and packages an iOS app into dropbox for deployment
<!DOCTYPE html>
<html lang='en-US' xml:lang='en-US' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-type' />
<title>iBots Beta</title>
<style type='text/css'>
body {
font-family: 'Helvetica Neue Light', HelveticaNeue-Light, Helvetica, Arial, sans-serif;
width: 600px;
margin: 0 auto;
@whatupdave
whatupdave / imdb_ratings.rb
Created December 16, 2010 07:51
Gets the IMDB ratings for the films at http://filmography2010.blogspot.com/
#!/usr/bin/ruby
require 'rubygems'
require 'imdb_party'
require 'mechanize'
def movie_list_2010
page = Mechanize.new.get 'http://filmography2010.blogspot.com/'
results = page.search 'div.entry-content a[href*="imdb"]'
results.map {|r| r[:href] =~ /(tt\d+)/; $1 }
end
9.0 Inception
8.9 Black Swan
8.8 Toy Story 3
8.8 The Way Back
8.6 127 Hours
8.4 The King's Speech
8.4 The Borrowers
8.3 The Social Network
8.2 How to Train Your Dragon
8.2 The Fighter
/*
example usage
=============
$('#target').machine({
stopped : {
enter : ['a.pause:hide', 'a.play:show'],
exit : ...,
'a.play:click' : 'playing'
},
class Object
def self.instance_methods_by_module
class_methods = []
self.ancestors.reverse.each do |a|
new_methods = a.instance_methods.sort
class_methods.each do |cm|
new_methods = new_methods - cm[1]
end
class_methods << [ a.name, new_methods ]
end
class ROpenStruct < OpenStruct
def initialize(hash=nil)
@table = {}
for k,v in hash
@table[k.to_sym] = wrap(v)
new_ostruct_member(k)
end
end
def wrap(value)
@whatupdave
whatupdave / commands
Created July 19, 2010 06:35
Static site in heroku
git init
git add .
git commit -m "Initial"
heroku create <APP>
heroku addons:add custom_domains
heroku domains:add <APP>.com
heroku domains:add www.<APP>.com
git push heroku master
@whatupdave
whatupdave / AwesomeTestExtensions.cs
Created December 8, 2009 23:08
Assert Awesomely
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;
using System.Linq;
using NUnit.Framework.Constraints;
namespace NUnit.Framework
{
public static class AwesomeTestExtensions