Skip to content

Instantly share code, notes, and snippets.

View adamloving's full-sized avatar
💭
10x Ninja Rockstar

Adam Loving adamloving

💭
10x Ninja Rockstar
View GitHub Profile
@adamloving
adamloving / fb-fan-export.js
Created January 18, 2011 01:02
Export Facebook Page Fans
/*
For more detailed instructions on how to use this script, sign up with your email here:
http://adamloving.com/internet-programming/how-toexport-facebook-page-fans
DISCLOSURE: This javascript runs in your browser pretending to be you
looking through your page fans. Facebook should have no problem with this,
but who knows if they will think it is strange to see you looking through
all your fans so quickly (the script waits 3s before requesting each page).
I've had no problem running this so far for 1000s of page fans, but I
@adamloving
adamloving / sms.rb
Created January 31, 2011 19:11
Simple Twilio Ruby Client Class
require 'twiliolib'
ACCOUNT_SID = 'big-hex-number'
ACCOUNT_TOKEN = 'another-big-hex-number'
# version of the Twilio REST API to use
API_VERSION = '2010-04-01'
# base URL of this application
BASE_URL = "http://myapp.com"
@adamloving
adamloving / stack-template.md
Created February 1, 2011 00:15
Fork this and describe your favorite development stack

Development Environment

  • Platform
  • IDE
  • Editing Font
  • Source Code Repo/host

Hosting

  • Hosting Provider
@adamloving
adamloving / kairos-stack.md
Created February 1, 2011 00:41
Components of the Kairos Stack

Development Environment

  • Platform: OS X 10.6.6
  • IDE: Textmate
  • Editing Font: Monaco 18pt
  • Source Code Repo/host: github

Hosting

@adamloving
adamloving / twibes-stack.md
Created February 1, 2011 00:53
Components of the software stack for Twibes.com

Stack for twibes.com

Development Environment

  • Platform: Mac OS X 10.6.6
  • IDE: TextMate
  • Editing Font: Monaco 18pt
  • Source Code Repo/host: SVN/Unfuddle (prefer git nowadays)

Hosting

@adamloving
adamloving / cache_manager.js
Created February 1, 2011 06:07
A class to monitor background updates to a HTML based iPhone application
/*
A class to monitor background updates to a HTML based iPhone application.
Note that this needs to be used in conjunction with an HTML5 Cache Manifest file
This originated from some sample code in this book:
http://www.amazon.com/Building-iPhone-Apps-HTML-JavaScript/dp/0596805780
*/
@adamloving
adamloving / installer_controller.rb
Created February 1, 2011 06:11
Rails controller action for an HTML5 cache manifest file.
class InstallerController < ApplicationController
# Rails controller action for an HTML5 cache manifest file.
# Generates a plain text list of files that changes
# when one of the listed files change...
# So the client knows when to refresh its cache.
def cache_manifest
@files = ["CACHE MANIFEST\n"]
@files << 'favicon.ico'
@adamloving
adamloving / bigdoorkit-sample.py
Created March 1, 2011 01:27
how to use BigDoorKit to create a user and award XP
import client
import restkit
app_key = 'xxx'
app_secret = 'yyy'
c = client.Client(app_secret, app_key)
username = 'adamloving'
sudo port install mysql5
sudo port install py26-mysql
get the junk from here
http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/
decompress it, then follow the instructions in readme
MySQL-python-1.2.3$ python setup.py build
MySQL-python-1.2.3$ sudo python setup.py install
@adamloving
adamloving / inheritance.js
Created April 13, 2011 21:12
Simulating inheritance with Javascript
// I'm not sure which of these is the best, they all have pros and cons.
// for more ideas, see http://ejohn.org/blog/simple-javascript-inheritance/
// ----- 1 [using functions as objects with prototypes]-----
function MyBaseClass() { };
MyBaseClass.prototype.myMethod = function() { };
function MyClass() {
MyBaseClass.call(this); // call base class constructor