Skip to content

Instantly share code, notes, and snippets.

@michealbenedict
michealbenedict / jq.simple_timer.js
Created May 22, 2011 12:08
Simple jQuery Timer Plugin
/*
* @Module Timer
* @author : Micheal
*
* @usage:
$(document).ready(function() {
$(".s1").timer({
from: 100, //sec
end: function() {
console.log('triggerd at the end of timer')
@michealbenedict
michealbenedict / stylus-express.js
Created May 22, 2011 21:28
Stylus + Express.js
var express = require('express');
var stylus = require('stylus');
var app = express.createServer();
// Configuration
app.use(stylus.middleware({
debug: true,
@michealbenedict
michealbenedict / gist:1018691
Created June 10, 2011 11:50 — forked from paulirish/gist:366184
html5 geolocation with fallback.
// geo-location shim
// currentely only serves lat/long
// depends on jQuery
;(function(geolocation){
if (geolocation) return;
var cache;
@michealbenedict
michealbenedict / short_code_generator.js
Created June 16, 2011 06:51 — forked from csanz/short_code_generator.js
Just a simple, mini short code generator.
// For Nodejs
const crypto = require('crypto');
/**
* Get Short Code
*
* Mini Short Code Generator
*
* @param {Number} size
@michealbenedict
michealbenedict / comma-first-var.js
Created June 17, 2011 11:08 — forked from isaacs/comma-first-var.js
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",

npm-coding-style(1) -- npm's "funny" coding style

DESCRIPTION

npm's coding style is a bit unconventional. It is not different for difference's sake, but rather a carefully crafted style that is designed to reduce visual clutter and make bugs more apparent.

If you want to contribute to npm (which is very encouraged), you should

// Lokki.js 0.2.0
// (c) 2011 Micheal
// Load Important Libs
var FS = require('fs')
, INFLECTION = require('./inflection')
, Express = require('express')
, App = Express.createServer();
// Constants
@michealbenedict
michealbenedict / gist:1164300
Created August 23, 2011 03:44 — forked from nzakas/gist:1164118
Ant target for autogenerating changelog based on Git tags
<!--
Ant target for autogenerating a changelog based on Git tags
Workflow:
1. Do all of your checkins for a given version.
2. When you're ready to officially create a new version, tag it using git tag, such as "git tag v0.3.0".
3. If you don't already have a file named CHANGELOG in the root directory, make one.
4. Run "ant changelog.update"
@michealbenedict
michealbenedict / github_post_commit.js
Created August 27, 2011 17:36 — forked from blindsey/github_post_commit.js
node.js auto deploy scripts
Steps:
0. Checkout your git repo from the server (I use /var/www/carbonite)
1. Upload both of these files to the same directory on your server
2. chmod +x restart_node.sh
3. nohup node github_post_commit.js 2>&1 >> github_post_commit.log &
4. In the github admin for your repo, set a post commit hook to the url http://<your host>:8080/
5. Make a commit to your repo
6. Point a browser at http://<your host>:8080/ and you should see the commit
@michealbenedict
michealbenedict / gist:1198709
Created September 6, 2011 19:30
android linux
# To make kernel
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
#Pull kernel config from running phone
adb pull /proc/config.gz ~/android/sources/kernel/
cd ~/android/sources/kernel/
gunzip config.gz