Skip to content

Instantly share code, notes, and snippets.

var TinyORM = (function(options) {
/* a hash containing all the available models */
var Models = {};
var connection = null;
var config = _.extend({
/* The name of the database which Ti will open. The local db is located at:
~/Library/Application Support/iPhone Simulator/4.2/Applications/APP_ID/Library/Application Support/database/dbname
*/
dbname: 'add.db',
var TinyORM = (function(options) {
/* a hash containing all the available models */
var Models = {};
var connection = null;
var config = _.extend({
/* The name of the database which Ti will open. The local db is located at:
~/Library/Application Support/iPhone Simulator/4.2/Applications/APP_ID/Library/Application Support/database/dbname
*/
dbname: 'add.db',
page_id = 102329749861
params = {
:v => '1.0',
:api_key => FACEBOOKER["api_key"],
:method => 'stream.get',
:format => 'XML',
:source_ids => page_id,
:session_key => 'bd7156a08fefbd368b54d2da-54500509',
:limit => 2
Marrily's data can be accessed via a RESTful interface. Here are the documentation on how to access the API. Currently the data are represented via JSON format only.
1. v1 API info
===============
The current API is at v1, and the all API access is over HTTP, starting with
http://api.marrily.com/api/v1/
If the subscription is expired, you will get a 402 error for non-GET requests (except for user's authentication).
@goldenboy
goldenboy / util.js
Created February 16, 2012 14:24 — forked from sr3d/util.js
/* Wrapper on top of the HTTP client */
function Request(url, options) {
if( !url ) { throw "Invalid URL"; };
options = _.extend({
method: 'GET',
async: true,
evalJSON: true,
parameters: {},
headers: [], // [ [key, value], [key, value] ]
onSuccess: function(){},
$ openssl req -new -key private.key -out marrily.com.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:US
openssl genrsa -out private.key 2048
Generating RSA private key, 2048 bit long modulus
..............................+++
.+++
e is 65537 (0x10001)
@goldenboy
goldenboy / gist:1845200
Created February 16, 2012 14:25 — forked from sr3d/gist:148499
# getting the facebook permanent session key.
s = Facebooker::Session.new( "API_KEY", "SESCRET_KEY")
s.auth_token = "THE_6_DIGIT_CODE"
s.secure! :generate_session_secret => false
puts s.session_key
@goldenboy
goldenboy / gist:1845201
Created February 16, 2012 14:25 — forked from sr3d/gist:134895
Dump a table to a CSV file
mysql -h HOST -u USERNAME --password=PASSWORD DATABASE -B -e "SELECT id,email,first_name,last_name,state,zip_code FROM users" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > filename.csv
sudo iptables -F
sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A INPUT -i ! lo -d 127.0.0.0/8 -j REJECT
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A OUTPUT -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 10000 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 3333 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 3000 -j ACCEPT