Skip to content

Instantly share code, notes, and snippets.

Madhusudhan Srinivasa madhums

Block or report user

Report or block madhums

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
madhums / gist:71eaa203f11a428cb8a2
Created Jun 14, 2014
remove files of a type recursively
View gist:71eaa203f11a428cb8a2
$ find app/views -name "*.jade" -type f|xargs rm -f
View req.js
var http = require('http')
var i = 0;
var j = 0;
// write data to request body
i = i + 1;
console.log('Sending request: ' + i);
http.get("http://localhost:3000", function(res) {
j = j + 1;
View .jshintrc
"bitwise": false,
"immed": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
"trailing": true,
"boss": true,
"eqnull": true,
madhums / .jshintignore
Last active Aug 29, 2015
Setup jshint and pre-commit checks
View .jshintignore
madhums / res.js
Last active Aug 29, 2015
returned object
View res.js
function callback (err, res) {
// res.request.href => is this is url of the uploaded file?
container: 'a-container',
remote: 'image-1.png'
}), callback);
// res =>
madhums / node-file-structure.js
Last active Aug 29, 2015
structure for writing module/api in node
View node-file-structure.js
* Module dependencies.
var http = require('http'); // native modules first
var mongoose = require('mongoose'); // npm modules second
var config = require('config'); // modules that are required via NODE_PATH third
var fmt = require('./format-date'); // local modules fourth
var oauth = require('../../oauth'); // relative modules last
madhums / gulpfile.js
Created Jul 18, 2015 — forked from danharper/gulpfile.js
ES6 project with Babel, Browserify & Gulp
View gulpfile.js
'use strict';
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
madhums /
Last active Sep 3, 2015
pleinvrees heroes
  • n'to
  • workals
  • oliver schoris
  • oliver koletzki
  • andhim
madhums / minifind.rb
Created Nov 12, 2010
mini-find - this will save a few key strokes!
View minifind.rb
class << ActiveRecord::Base
alias_method :[], :find
@post = Post[5]
@post = Post[:first]
@post = Post[:all, :conditions => { :name => "first post" }]
madhums / omniauth.rb
Created Nov 15, 2010
OmniAuth configuration for rails 2.3.x
View omniauth.rb
require 'openid/store/filesystem'
ActionController::Dispatcher.middleware.use OmniAuth::Builder do #if you are using rails 2.3.x
#Rails.application.config.middleware.use OmniAuth::Builder do #comment out the above line and use this if you are using rails 3
provider :twitter, 'key', 'secret'
provider :facebook, 'app_id', 'secret'
provider :linked_in, 'key', 'secret'
provider :open_id,'/tmp')
You can’t perform that action at this time.