Skip to content

Instantly share code, notes, and snippets.

@bernos
bernos / grunt.js
Created June 16, 2012 04:44 — forked from johnkpaul/gist:2361303
gruntjs Mocha task
module.exports = function(grunt) {
grunt.initConfig({
mocha : {
all : {
src : 'test/**/*.js', // path to test.js files
options : {
globals : ['piewpiew'],
ui : 'tdd',
reporter : 'spec'
@bernos
bernos / gist:2772790
Created May 23, 2012 01:47
Add svn props to existing files from bash
find . \( -name "*.php" -o -name "*.js" \) -exec svn propset svn:keywords Id {} \;
@bernos
bernos / hack.sh
Created March 31, 2012 23:09 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@bernos
bernos / index-with-amd.html
Created February 8, 2012 03:53
A javascript module template which supports an AMD loader (like requirejs) when available, but fails over to adding the module to a specified root context when an AMD loader is not available.
<!doctype html>
<html lang="en">
<head>
<title></title>
</head>
<body>
<script data-main="main-with-amd" src="requirejs-1.0.4.min.js"></script>
</body>
</html>
@bernos
bernos / Aus mobile validator
Created April 15, 2011 00:51
Validates a number is a valid australian mobile
function(value) {
return String(value).match(/^04[0-9]{8}$/) != null;
}