Skip to content

Instantly share code, notes, and snippets.

View adityamenon's full-sized avatar

Aditya MP adityamenon

View GitHub Profile
@adityamenon
adityamenon / index.js
Last active January 4, 2016 16:32 — forked from PhilKershaw/gist:2171814
Simple example of using 2-legged OAuth in Node.js (requires node-oauth)
var express = require('express');
var oauth = require('oauth');
var sys = require('sys');
var app = express.createServer();
var key = "[api-key]";
var secret = "[api-secret]";
var request = new oauth.OAuth(null, null, key, secret, '1.0', null, 'HMAC-SHA1');
app.get('/api-request', function(req, res){
request.get(

We are gonna be using php5.5 , so upgrade your systems to that.

  1. http://laravel.com/docs/contributing#coding-guidelines , we follow these, along with PSR-0 and PSR-1.

  2. use Foo (aliasing) etc statements should start from the 3rd line. Each class that needs to be used in a namespace has to be aliased in a separate line.

  3. Aliasing is important. You shouldn't be using more than two Namespace Separators (\) in the code that you right in your classes. Try to restrict the count of those namespace separators to one.

  4. No accessing global namespace (ie, \Foo is not allowed, you need to alias the class Foo via use Foo). The only exception for this is php spl exception classes.

We are gonna be using php5.5 , so upgrade your systems to that.

  1. http://laravel.com/docs/contributing#coding-guidelines , we follow these, along with PSR-0 and PSR-1.

  2. use Foo (aliasing) etc statements should start from the 3rd line. Each class that needs to be used in a namespace has to be aliased in a separate line.

  3. Aliasing is important. You shouldn't be using more than two Namespace Separators (\) in the code that you right in your classes. Try to restrict the count of those namespace separators to one.

  4. No accessing global namespace (ie, \Foo is not allowed, you need to alias the class Foo via use Foo). The only exception for this is php spl exception classes.