Skip to content

Instantly share code, notes, and snippets.

View mdarse's full-sized avatar

Mathieu Darse mdarse

  • Paris
View GitHub Profile
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@mdarse
mdarse / clone.js
Created August 2, 2013 10:13 — forked from Raynos/clone.js
function clone(o) {
return Object.create(
Object.getPrototypeOf(o),
Object.getOwnPropertyDescriptors(o)
);
}
function cloneObject(object) {
return extendObject({}, object);
}
function extendObject(base, object) {
var visited = [object];
// http://en.wikipedia.org/wiki/Adjacency_list_model
var set = [{value: base}];
#!/bin/bash
# Put this file at: .git/hooks/post-checkout
# and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
POST_COMMIT=$2
NOCOLOR='\e[0m'
jasmine.Matchers.prototype.toBePromise = ->
this.actual.done && !this.actual.resolve
jasmine.Matchers.prototype.toBeRejected = -> this.actual.isRejected()
jasmine.Matchers.prototype.toBeResolved = -> this.actual.isResolved()
jasmine.Matchers.prototype.toBeResolvedWith = ->
expectedArgs = jasmine.util.argsToArray(arguments);
unless this.actual.done
throw new Error('Expected a promise, but got ' + jasmine.pp(this.actual) + '.');
@mdarse
mdarse / handlebars-helpers.js
Created November 15, 2012 00:05 — forked from elidupuis/handlebars-helpers.js
Simple Handlebars.js helpers
/*! ******************************
Handlebars helpers
*******************************/
// debug helper
// usage: {{debug}} or {{debug someValue}}
// from: @commondream (http://thinkvitamin.com/code/handlebars-js-part-3-tips-and-tricks/)
Handlebars.registerHelper("debug", function(optionalValue) {
console.log("Current Context");
console.log("====================");
@mdarse
mdarse / junkmail.php
Created August 22, 2012 02:51 — forked from maximevalette/junkmail.php
Détecter les adresses junkmail
<?php
function junkMail($mail) {
$domains = array('pjjkp.com', 'ephemail.com', 'ephemail.org', 'ephemail.net', 'jetable.org', 'jetable.net', 'jetable.com', 'yopmail.com', 'haltospam.com', 'tempinbox.com', 'brefemail.com', '0-mail.com', 'link2mail.net', 'mailexpire.com', 'kasmail.com', 'spambox.info', 'mytrashmail.com', 'mailinator.com', 'dontreg.com', 'maileater.com', 'brefemail.com', 'yopmail.com', '0-mail.com', 'brefemail.com', 'ephemail.net', 'guerrillamail.com', 'guerrillamail.info', 'haltospam.com', 'iximail.com', 'jetable.net', 'jetable.org', 'kasmail.com', 'klassmaster.com', 'kleemail.com', 'link2mail.net', 'mailin8r.com', 'mailinator.com', 'mailinator.net', 'mailinator2.com', 'myamail.com', 'mytrashmail.com', 'nyms.net', 'shortmail.net', 'sogetthis.com', 'spambox.us', 'spamday.com', 'Spamfr.com', 'spamgourmet.com', 'spammotel.com', 'tempinbox.com', 'yopmail.com', 'yopmail.fr', 'guerrillamail.org', 'temporaryinbox.com', 'spamcorptastic.com', 'filzmail.com', 'lifebyfood.com', 'tempemail.net', 'spamfr
@mdarse
mdarse / gist:3421633
Created August 22, 2012 02:29 — forked from maximevalette/gist:3307568
Supprimer .DS_Store
find . -name .DS_Store -type f -exec rm -v {} \;
@mdarse
mdarse / MIT-LICENSE.txt
Created July 19, 2012 15:37 — forked from jgarber/MIT-LICENSE.txt
Responsive video
Copyright (c) 2011 ZURB, http://www.zurb.com/