Skip to content

Instantly share code, notes, and snippets.

View lbdremy's full-sized avatar

Remy Loubradou lbdremy

View GitHub Profile
The ExpressJS-MongooseJS.org initiative ;)
Trying to come up with a standard expressjs + mongoose mvc-like folder structure.
still keep it flexible, so anyone can do whatever they want,
but provide a structure for new people.
(borrowing a little form rails)
-/app
--/controller
@lbdremy
lbdremy / css3.styl
Created May 22, 2011 21:28 — forked from towtow/css3.styl
A collection of mixins for Stylus to make using css3 a breeze
// MIXINS
vendor(prop, args)
-webkit-{prop} args
-moz-{prop} args
-o-{prop} args
{prop} args
animation()
vendor('animation', arguments)
@lbdremy
lbdremy / domains.js
Created August 9, 2011 11:24
List of Internet top-level domains
var domains = { '.arpa': true,'.root': true,'.aero': true,'.biz': true,'.cat': true,'.com': true,'.coop': true,'.edu': true,'.gov': true,'.info': true,'.int': true,'.jobs': true,'.mil': true,'.mobi': true,'.museum': true,'.name': true,'.net': true,'.org': true,'.pro': true,'.travel': true,'.ac': true,'.ad': true,'.ae': true,'.af': true,'.ag': true,'.ai': true,'.al': true,'.am': true,'.an': true,'.ao': true,'.aq': true,'.ar': true,'.as': true,'.at': true,'.au': true,'.aw': true,'.az': true,'.ba': true,'.bb': true,'.bd': true,'.be': true,'.bf': true,'.bg': true,'.bh': true,'.bi': true,'.bj': true,'.bm': true,'.bn': true,'.bo': true,'.br': true,'.bs': true,'.bt': true,'.bv': true,'.bw': true,'.by': true,'.bz': true,'.ca': true,'.cc': true,'.cd': true,'.cf': true,'.cg': true,'.ch': true,'.ci': true,'.ck': true,'.cl': true,'.cm': true,'.cn': true,'.co': true,'.cr': true,'.cu': true,'.cv': true,'.cx': true,'.cy': true,'.cz': true,'.de': true
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@lbdremy
lbdremy / sax-test.js
Created October 4, 2011 16:14
Test Sax. The `text` event is called two times. Why?
var sax = require('sax'),
fs = require('fs');
var strict = true;
var tag;
// Stream usage
// takes the same options as the parser
var saxStream = require("sax").createStream(strict)
saxStream.on("error", function (err) {
// unhandled errors will throw, since this is a proper node
@lbdremy
lbdremy / prettify.css
Created January 22, 2012 23:27
Prettify from howtonode.org
/* Pretty printing styles. Used with prettify.js. */
pre code {
font-family: 'Monaco', 'Menlo', monospace;
font-size: 13px;
background-color: #1c1d1e;
display: block;
padding: 20px;
overflow: auto;
margin: 20px 0px;
clear: both;
var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.pus
@lbdremy
lbdremy / wsse_auth.js
Created March 24, 2012 12:37
WSSE Auth
function Client(){
this.host = 'api.cibo.io';
this.path = '';
}
Client.prototype.login = function(email,password,callback){
this.email = email; // email can be an username or something else, it's just an unique value about the user.
this.password = password;
this.headers = {
'Authorization' : 'WSSE profile="UsernameToken"',
@lbdremy
lbdremy / events-groups-toulouse.md
Created May 11, 2012 09:21
Evènements et Groupes tech & web à Toulouse
@lbdremy
lbdremy / jetty-logging.xml
Created July 19, 2012 17:42
Logging config jetty
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<!-- ############################################################### -->
<!-- # Logging configuration # -->
<!-- ############################################################### -->
<!-- # stderr Log # -->
<New id="stderrLog" class="java.io.PrintStream">
<Arg>