Skip to content

Instantly share code, notes, and snippets.

View rnarian's full-sized avatar
😱
It's complicated

Marian Friedmann rnarian

😱
It's complicated
View GitHub Profile
@rnarian
rnarian / mini-modernizr.html
Created April 5, 2016 12:33 — forked from tomblanchard/mini-modernizr.html
Mini Modernizr: I only ever use Modernizr mostly to check for JS and / or touch screen devices. This tiny piece of code will replace the classes which are on the `<html>` element `no-js` with `js` and `no-touch` with `touch`.
<script>!function(a,b){"use strict";b.documentElement.className=b.documentElement.className.replace("no-js","js"),("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)&&(document.documentElement.className=document.documentElement.className.replace("no-touch","touch"))}(window,document);</script>
@rnarian
rnarian / commit-msg
Last active March 14, 2016 10:26 — forked from stefansundin/install-pre-commit.sh
Git pre-commit check to stop accidental commits to master and develop branches. There is also a variant with a core.whitespace check.
#!/bin/bash
# Stops accidental commits to master and develop. Exceptions to commits starting with "Release".
# https://gist.github.com/rnarian/5bb974bd876beb5de11f
# Install:
# cd path/to/git/repo
# curl -fL -o .git/hooks/commit-msg https://gist.githubusercontent.com/rnarian/5bb974bd876beb5de11f/raw/commit-msg
# chmod +x .git/hooks/commit-msg
BRANCH=`git rev-parse --abbrev-ref HEAD`
MESSAGE=$(cat .git/COMMIT_EDITMSG)
@rnarian
rnarian / funny-console-log.js
Created March 31, 2014 14:28 — forked from cfj/console.reverselog.js
Reverse console.log
var _log = console.log;
window.console.log = function(log){
_log.call(console, log.reverse ? log.reverse() : typeof log === 'string' ? log.split('').reverse().join('') : typeof log === 'number' ? log.toString().split('').reverse().join('') : log);
};
@rnarian
rnarian / 0_reuse_code.js
Created February 20, 2014 08:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console