Skip to content

Instantly share code, notes, and snippets.

@dphase
dphase / TODO
Created October 26, 2010 19:29
TODO
android_device_htc_bravoc
-------------------------
[ ] New APNS settings for Cellular South
android_frameworks_base
-----------------------
[ ] Lockscreen layout
@dphase
dphase / hack.sh
Created April 13, 2012 16:56 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@dphase
dphase / week6.rb
Created May 25, 2012 13:26
adjacent numbers
#!/usr/bin/env ruby
# ------------------------------------------------------------------------------------
# In the 2020 grid below, we take four numbers along a diagonal line starting at 8,6
#
# The product of these numbers is 26 63 78 14 = 1788696.
#
# What is the greatest product of four adjacent numbers in any direction
# (up, down, left, right, or diagonally) in the 20x20 grid?
# ------------------------------------------------------------------------------------
@dphase
dphase / kewsh.rb
Created October 9, 2012 22:32
kewsh
#!/usr/bin/env ruby
# ---------------------------------------------------------------------
# kewsh dawg
# ---------------------------------------------------------------------
require "mechanize"
abort('Must supply site as argument') if ARGV[0].nil?
url = ARGV[0]
@dphase
dphase / ruby_radix.c
Created October 16, 2012 14:39
ruby_radix
// --------------------------------------------------------------------
// Radix Sort for Ruby
// josh@bcg.io
//
// EXAMPLE:
// --------------------------------------------------------------------
// require 'ruby_radix'
// [10,2,24,38,1,9,42].radix_sort
// => [1, 2, 9, 10, 24, 38, 42]
//
@dphase
dphase / base.rb
Created October 16, 2012 16:51
padrino/sinatra RESTful JSON example
# ---------------------------------------------------------------------
# User Demographics
# ---------------------------------------------------------------------
get :user, :map => '/user', :with => :id, :provides => :json do
_user = Auth[:userid => params[:id]]
user = Hash.new
user[:userid] = _user.userid
user[:firstname] = _user.firstname
user[:lastname] = _user.lastname
@dphase
dphase / bcg_highchart.js
Created October 17, 2012 14:07
BCG HighChart
// --------------------------------------------------------------------
// BCG Highchart
// --------------------------------------------------------------------
// Creating a new Highchart object for each chart gets very repetitive.
// Using jQuery extend, we can create charts with a predefined set of
// defaults.
//
// EXAMPLE:
//
// var fooChart = {
@dphase
dphase / insect.rb
Created October 18, 2012 20:01
json example
get :school, :map => '/school', :with => :id, :provides => [:json] do
school = Schools[:schoolid => params[:id]]
school.to_json
end
@dphase
dphase / boot.rb
Created October 18, 2012 20:06
padrino pry
# ---------------------------------------------------------------------
# Make pry your default shell for padrino console
# ---------------------------------------------------------------------
Padrino.before_load do
begin
$VERBOSE = nil
IRB = Pry
$VERBOSE = false
rescue LoadError
end
Can you zip these and throw on DropBox?
/System/Library/Frameworks/WebKit.framework
/System/Library/Frameworks/JavaScriptCore.framework
/System/Library/PrivateFrameworks/WebKit2.framework