Skip to content

Instantly share code, notes, and snippets.

View roboshoes's full-sized avatar

Mathias Paumgarten roboshoes

View GitHub Profile
@roboshoes
roboshoes / Gulpfile.js
Last active November 11, 2015 20:08 — forked from webdesserts/Gulpfile.js
Automatically reload your node.js app on file change with Gulp (https://github.com/wearefractal/gulp).
var gulp = require( "gulp" );
var spawn = require( "child_process" ).spawn;
var node;
gulp.task( "server", function() {
if ( node ) node.kill();
node = spawn( "node", [ "app.js" ], { stdio: "inherit" } );
@roboshoes
roboshoes / .bash_profile
Last active March 10, 2017 19:54
Personal terminal style
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
PS1='\nubi ${debian_chroot:+($debian_chroot)}\[\033[00;33m\]\u \[\033[00;32m\]\w\[\033[00;36m\]$(parse_git_branch)\[\033[00m\]:\n➜ '
@roboshoes
roboshoes / _cover-background.scss
Last active December 13, 2015 22:09
This let's you set a background image with background-size set to cover and have it working down to IE8 (I believe also IE7?!). It's based on SCSS and uses Compass (http://compass-style.org/). There is one little flaw: while the `url()` is reltive to the css file the filter is relative to the HTML document. The whole "../../" is not really clean…
@mixin cover-background( $path ) {
background-image: url( "../../" + $path );
@include background-size( cover );
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + $path + "', sizingMethod='scale')";
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale");
}
@roboshoes
roboshoes / Default (Windows).sublime-keymap
Last active December 12, 2015 04:49
Personal Sublime Text 2 settings
[
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
{ "keys": ["ctrl+e"], "command": "encode_html_entities" }
]
@roboshoes
roboshoes / touchmouse.js
Created April 13, 2012 10:43
This snippet maps mouse events and touch events onto one single event. This makes it easier in the code since you have to listen to only one event regardles whether it's desktop or mobile.
(function() {
/* == GLOBAL DECLERATIONS == */
TouchMouseEvent = {
DOWN: "touchmousedown",
UP: "touchmouseup",
MOVE: "touchmousemove"
}
/* == EVENT LISTENERS == */