Skip to content

Instantly share code, notes, and snippets.

View tilmanschweitzer's full-sized avatar

Tilman Schweitzer tilmanschweitzer

View GitHub Profile
while [[ ! $RELATIVE_PATH_CHECKED =~ ^[Yy]$ ]]
do
read -p "Is the relative path to the dev folder '${RELATIVE_PATH}' correct? [y/n] " -n 1 -r RELATIVE_PATH_CHECKED
echo ""
if [[ $RELATIVE_PATH_CHECKED =~ ^[Nn]$ ]]
then
read -p "Type in the correct path: " -r RELATIVE_PATH
fi
done
// load the $http module
var $http = angular.injector(["ng"]).get("$http");
$http.
@tilmanschweitzer
tilmanschweitzer / date
Created September 10, 2014 21:20
Date Variable (sh)
DATE=$(date +"%Y-%m-%d--%H-%M-%S")
@tilmanschweitzer
tilmanschweitzer / intercept-function.js
Last active September 23, 2022 18:25
Function to intercept functions calls even to nativ functions.
function interceptFunction (object, fnName, options) {
var noop = function () {};
var fnToWrap = object[fnName];
var before = options.before || noop;
var after = options.after || noop;
object[fnName] = function () {
before.apply(this, arguments);
var result = fnToWrap.apply(this, arguments);
after.apply(this, arguments);
@tilmanschweitzer
tilmanschweitzer / cdalias
Created November 10, 2011 13:34
Makes an alias for cd'ing to the current directory.
#!/bin/sh
###
# cdalias
###
# Makes an alias for cd'ing to the current directory.