Skip to content

Instantly share code, notes, and snippets.

View fizerkhan's full-sized avatar

Fizer Khan (பைசர் கான்) fizerkhan

View GitHub Profile
@shripadk
shripadk / gist:652819
Created October 29, 2010 03:10
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@subtleGradient
subtleGradient / appify
Created November 11, 2010 16:03
appify. Create the simplest possible mac app from a shell script
#!/usr/bin/env bash
#
# url : https://gist.github.com/672684
# version : 2.0.2
# name : appify
# description : Create the simplest possible mac app from a shell script.
# usage : cat my-script.sh | appify MyApp
# platform : Mac OS X
# author : Thomas Aylott <oblivious@subtlegradient.com>
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@tmahesh
tmahesh / measurePageloadTimes.js
Created February 18, 2011 00:56
How fast is my site? integrate boomerang and google analytics
<script type="text/javascript">
BOOMR.init({
beacon_url: "/boomerang.gif",
BW: {
enabled: false
}
});
BOOMR.subscribe('before_beacon', trackInAnalytics);
var pageType = "homepage"; // customize this
// Build the https based part & read the key and crt file that is required to encrypte the server / client connection
var ssl = https.createServer({
key: fs.readFileSync( "./ssl/ssl.private.key" ).toString()
, cert: fs.readFileSync( "./ssl/ssl.crt" ).toString()
});
// This is the part what it's all about, we are going to route all
// https based requires to the default app handler
ssl.addListener( "request", function sllRequestListener( req, res ){
req.ssl = true; // just add an extra flag so we can see if it was forwarded from https
@alkema
alkema / deploy.rb
Created July 9, 2011 20:01
Capistrano task for a Node.js app with github Forever and NPM.
set :application, "appname"
set :deploy_to, "/var/www"
set :scm, :git
set :repository, "git@github.com:user/app.git"
default_run_options[:pty] = true
set :user, "www-data"
set :domain, "foo.tld"
set :normalize_asset_timestamps, false
@kmiyashiro
kmiyashiro / layout2.jade
Created August 11, 2011 18:50 — forked from monokrome/layout2.jade
HTML5 Boilerplate Conditional comments in Jade
!!! 5
//if lt IE 7
html(class="no-js ie6 oldie", lang="en")
//if IE 7
html(class="no-js ie7 oldie", lang="en")
//if IE 8
html(class="no-js ie8 oldie", lang="en")
// [if gt IE 8] <!
html(class="no-js", lang="en")
// <![endif]
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@rstacruz
rstacruz / model_caching.coffee
Created September 11, 2011 14:54
Backbone.js model caching
# ## Backbone model caching
# This is a simple solution to the problem "how do I make less requests to
# my server?".
#
# Whenever you need a model instance, this will check first if the same thing
# has been fetched before, and gives you the same instance instead of fetching
# the same data from the server again.
#
# Reusing the same instance also has the great side-effect of making your
# model changeable from one part of your code, with your changes being available
@bergie
bergie / .gitignore
Created September 19, 2011 15:50
Node.js email handling examples
config.json
reading-image.png