Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
require 'rubygems'
require 'mechanize'
require 'yaml'
config = YAML.load_file(File.expand_path("~/.simple-note-backup.yml"))
email = config['email']
password = config['password']

##Given Apache 2 and MySQL are already installed.

#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated

#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules

@amwhalen
amwhalen / gist:2292325
Created April 3, 2012 14:16
Localizing Dates for Archive My Tweets
<?php
// config.php
// place this at the top of your config.php file
date_default_timezone_set('Europe/Berlin');
setlocale(LC_TIME, 'de_DE');
// index.php
// replace the date() function with a localized version (around lines 48 and 150)
@amwhalen
amwhalen / gist:936880
Created April 22, 2011 15:26
SproutCore DataSource POST is redirecting automatically, so the response parameter of didCreateRecord is a GET response instead of a POST response
createRecord: function(store, storeKey) {
if (SC.kindOf(store.recordTypeFor(storeKey), Library.Slideshow)) {
SC.Request.postUrl('/api/slideshow').header({ 'Accept': 'application/json' }).json()
.notify(this, this.didCreateRecord, store, storeKey)
.send(store.readDataHash(storeKey));
return YES;
}