Skip to content

Instantly share code, notes, and snippets.

View mklabs's full-sized avatar

Mickael Daniel mklabs

View GitHub Profile
@mklabs
mklabs / Makefile
Last active August 26, 2017 09:53
node makefile - babel / eslint / mocha / watch
test:
mocha test/
babel:
babel lib/ -d src/
lint:
eslint .
build: babel test lint
@mklabs
mklabs / Gruntfile.js
Last active December 10, 2015 17:38
A simple example of using yeoman on an express app
module.exports = function(grunt) {
function noop() {}
grunt.initConfig({
watch: {
reload: {
files: ['public/**', 'views/**'],
tasks: 'reload'
}
@mklabs
mklabs / docs.js
Created September 19, 2012 10:00
Grunt markdown task, compiling down to html, triggering reload
var path = require('path');
var hogan = require('hogan');
var marked = require('marked');
module.exports = function(grunt) {
// Basic grunt task to use along watch task, possibly the reload task
// of yeoman server. Designed to work with any given webserver, as
// long as the LiveReload extension for your favorite browser is used
// (http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions-).
@mklabs
mklabs / client.js
Created May 23, 2012 22:08
node script experiments at driving chrome via ws
var nopt = require('nopt'),
parse = require('url').parse,
WebSocket = require('faye-websocket');
//
// All based and derived on: http://www.igvita.com/2012/04/09/driving-google-chrome-via-websocket-api
//
// The remote debugging protocol is... I don't have words right now.
// Other than thanks thanks thanks thanks x10e901920
#!/bin/sh
#
# A word about this shell script:
#
# It must work only on systems with a /bin/bash.
#
# cat readme.md || exit 1
@mklabs
mklabs / test.txt
Created March 25, 2012 23:22
test
# cucumberjs + zombiejs + grunt
# this makes testing easier than ever
> [email protected] pretest /Users/mk/Temp/dev/mklabs/node-build-script
> git submodule update --init && rm -rf .test && mkdir .test && cp -r test/h5bp/* test/h5bp/.htaccess .test/
> [email protected] test /Users/mk/Temp/dev/mklabs/node-build-script
> node test --log && cd test && node ../node_modules/cucumber/bin/cucumber.js
@mklabs
mklabs / app.js
Created March 14, 2012 16:57
Backbone handy walk the application object to bridge event triggered to function calls
(function(exports) {
// change app to whatever.
var app = exports.app = Object.create(_.extend({}, Backbone.Events, {
// map over the backbone api to an EventEmitter like one
emit: Backbone.Events.trigger
}));
// top-level application namespaces
app.controllers = {};
@mklabs
mklabs / .md
Created February 13, 2012 19:09
browserify windows

Got some issue running browserify on windows. Some notes and the corresponding files patched. Not ran the browserify tests (should do) but tested on a rather complex build, working on both win32, osx.


  • browserify: lib/wrap.js wrappers/prelude.js
  • resolve: index.js

might issue a pull request, this needs tests, I need time (and sleeeeeeeep)

var fs = require('fs'),
path = require('path'),
url = require('url'),
socketio = require('socket.io'),
connect = require('connect'),
mime = connect.static.mime,
// one time-hit, get the file content of the socket.io client side script
ioScript = underscore.template(fs.readFileSync(path.join(__dirname, 'util/socket-enable.js'), 'utf8'));
//
@mklabs
mklabs / build.js
Created January 2, 2012 22:01
markdown to prez thing
// simple markdown to prez converter
// this uses the really neat impress.js as a presentation framework support.
// slides are delimited by h3 level title.