Skip to content

Instantly share code, notes, and snippets.

View shiawuen's full-sized avatar

Tan Shiaw Uen shiawuen

View GitHub Profile
@shiawuen
shiawuen / crunchbase-api-v1.md
Created November 22, 2011 14:52 — forked from dominicsayers/crunchbase-api-v1.md
CrunchBase API v1

NOTE: This documentation has been put here because I couldn't find it anywhere else. I am not associated with Crunchbase in any way. I cannot help you with your Crunchbase API problems. If you need help try here: https://groups.google.com/forum/#!forum/crunchbase-api

CrunchBase API v1 Documentation

Overview

The CrunchBase API provides JSON representations of the data found on CrunchBase. The API currently supports three actions: "show", "search", and "list", which are each described below.

@shiawuen
shiawuen / path.js
Created September 1, 2011 17:46
prevent access /etc/passwd
var path = require('path')
var userPath = path.normalize('/var/www/app/abc/../../../../../../../../../../etc/passwd')
if (userPath.indexOf(__dirname) == 0 ) {
// Valid path
} else {
// Invalid path
}
@shiawuen
shiawuen / depot.add.js
Created March 17, 2011 03:56
Problem with using Depot.add, callback never get trigger and the line after the add never get executed. Failed silently…
var db = new Mojo.Depot(
{ name: 'my_wordpress_db', version: 1, estimatedSize: 25000, replace: false },
function() { Mojo.Log.info('Success'); },
function(error) { Mojo.Log.warn('Unable to open database (#' +error+ ')' ); }
);
// NOT WORKING
db.add(
'address', 'address',
function(){ Mojo.Log.info('Address Added'); },