Skip to content

Instantly share code, notes, and snippets.

@michealbenedict
michealbenedict / application.rb
Created February 2, 2012 19:54 — forked from mcmire/application.rb
Integrating the Logging framework into your Rails 3 app
#-----------------------------------------------------------------------------------------------
# config/application.rb
#-----------------------------------------------------------------------------------------------
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(:default, Rails.env) if defined?(Bundler)
# Bring in the Railtie that will set Rails' various logger variables to
# instances of Logging::Logger instead of Rails' built-in ActiveSupport::BufferedLogger.
// forked from tyfkda's "ぐるぐる" http://jsdo.it/tyfkda/rukS
var FPS = 1;
var canvas = document.getElementById("world");
var ctx = canvas.getContext("2d");
var width = canvas.width;
var height = canvas.height;
var angStep = 0;
@michealbenedict
michealbenedict / jquery.ba-tinypubsub.js
Created December 12, 2011 20:37 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@michealbenedict
michealbenedict / ruby-class.js
Created November 25, 2011 20:12
Ruby-style classes in ECMAScript 5
var Class = Object.create(null, {
"new": {
"value": function () {
var result = Object.create(this, {
"class": {
"value": this
}
});
result.initialize.apply(result, arguments);
return result;
@michealbenedict
michealbenedict / LICENSE.txt
Created November 2, 2011 18:24 — forked from jed/LICENSE.txt
write contextual templates
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@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
@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: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"
// 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

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