Skip to content

Instantly share code, notes, and snippets.

View mklabs's full-sized avatar

Mickael Daniel mklabs

View GitHub Profile
@isaacs
isaacs / module-api-ref.json
Created February 9, 2012 04:47
This is an example format for the API reference documentation for a node module, in json
{ type: 'module',
name: 'cluster',
desc: 'The long html description thing at the beginning, examples, etc.',
events:
[ { type: 'event',
name: 'fork',
arguments: [ { name: 'worker', type: 'object', class: 'Worker' } ],
desc: 'blahblah long html description' },
{ type: 'event',
name: 'ready',
@jeffreyiacono
jeffreyiacono / Rakefile
Created February 8, 2012 20:15
rake task for precompiling assets using sprockets within a sinatra app + view helpers
require 'rubygems'
require 'bundler'
Bundler.require
require './application'
namespace :assets do
desc 'compile assets'
task :compile => [:compile_js, :compile_css] do
end
@fat
fat / index.js
Created January 12, 2012 17:43
Bootstrap Build Server
// ========================================================================
// bootstrap-builder v0.1.0
// http://twitter.github.com/bootstrap
// ========================================================================
// Copyright 2011 Twitter, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
@mmalecki
mmalecki / .travis.yml
Created January 7, 2012 01:44
Basic `.travis.yml` you should be using for your project
language: node_js
node_js:
- 0.4
- 0.6
@nikreiman
nikreiman / gist:1408399
Created November 30, 2011 08:06
Unix date formatting cheat sheet
Day
---
%a weekday, abbreviated Tue
%A weekday, full Tuesday
%d day of the month (dd), zero padded 22
%e day of the month (dd) 22
%j day of year, zero padded 001-366
%u day of week starting with Monday (1), i.e. mtwtfss 2
%w day of week starting with Sunday (0), i.e. smtwtfs 2
@madrobby
madrobby / i18n.coffee
Created November 14, 2011 15:45
Backbone i18n with CoffeeScript
# before this file is loaded, a locale should be set:
#
# In a browser environment, you can use:
# ```<script>__locale='en';</script>```
#
# In a server environment (specifically node.js):
# ```global.__locale = 'en';```
# normalize in-app locale string to "en" or "de-AT"
parts = @__locale.split('-')
@indexzero
indexzero / opensource-guidelines.md
Created November 9, 2011 01:54
The least amount of guidelines possible to maintain 150+ open source node.js modules

Guidelines for Open Source at Nodejitsu

README.md Outline

  • Header
    • Brief description (should match package.json)
  • Example (if applicable)
  • Motivation (if applicable)
  • API Documentation: This will likely vary considerably from library to library.
  • Installation
@indexzero
indexzero / jshint.json
Created October 4, 2011 23:48
JSHint settings used @nodejitsu
{
"passfail": false,
"maxerr": 100,
"browser": true,
"node": true,
"rhino": false,
"couch": true,
"wsh": true,
"jquery": true,
@mattpodwysocki
mattpodwysocki / jsconf-eu-2011.md
Created October 1, 2011 13:40
JSConf.EU Slides
@cowboy
cowboy / jquer.ba-wtf-animation.js
Created September 29, 2011 17:07
jQuery: a little WTF text animation :)
// Iterate over a bunch of elements.
$(":header, p, li").each(function() {
// The current element.
var elem = $(this);
// A copy of the current element that will take its place in the DOM during
// the animation.
var copy = elem.clone().replaceAll(elem);
// The element's text content. To be animated, character-by-character.
var text = copy.text();