Skip to content

Instantly share code, notes, and snippets.

View Ulflander's full-sized avatar

Xav Laumonier Ulflander

View GitHub Profile
#!/bin/sh
read -e -p "Path from:" PATH_FROM
echo "New folder on backup disk: "
read NEW_FOLDER
rsync -r --exclude '.git' --exclude 'bower_components' --exclude 'node_modules' --exclude '.venv' "$PATH_FROM" "/Volumes/Work I/$NEW_FOLDER"
(function(){
var d = document,
w = window,
templates = {},
models = {},
store = {},
readyCbs = [],
ready = false,
router = new Rlite(),
@Ulflander
Ulflander / gist:2002ad0349b1650dbdce
Created June 17, 2015 10:57
Git branch in terminal snippet
function set_prefix {
if [[ -d '.git' ]]; then
echo "["`git rev-parse --abbrev-ref HEAD`"] "
else
echo ""
fi
}
PS1='\u@\h:\w `set_prefix`>> '
/**
* Extend an object with other objects.
*
* @function
* @name extend
* @return {object} Extended object
*/
hunk('extend', function(/* obj, objs...*/){
var i = 1,
@Ulflander
Ulflander / gist:e0f50f6d8bb52fc4c85b
Created October 3, 2014 09:35
Dataviz JS tools utlimate list
@Ulflander
Ulflander / gist:a22d7765197b3bfacd9f
Created October 2, 2014 11:05
Frontend shell aliases
# Various
alias s='subl .'
alias flushdns='sudo killall -HUP mDNSResponder'
alias l='ls -al'
# Bower
alias bid='bower install --save-dev '
alias bis='bower install --save '
@Ulflander
Ulflander / gist:eb8847f5a0507d43579c
Created September 3, 2014 15:53
Working JSDoc with Gulp
var gulp = ...,
jsdoc = require('gulp-jsdoc');
gulp.task('js-doc', function() {
return gulp.src([
'README.md',
'src/js/*.js',
'src/js/**/*.js'
])
var fs = require('fs');
var Buffer = require('buffer').Buffer;
var i = 0;
var j = 0;
fs.open("archive", 'r', function(status, fd) {
if (status) {
console.log(status.message);
return;
}
@Ulflander
Ulflander / gist:e01580567c43d4cb104c
Last active August 29, 2015 14:05
English Inflector class
package com.ulflander.utils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
package main
import (
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"time"
)
type (
Leader struct {