Skip to content

Instantly share code, notes, and snippets.

View digitalkaoz's full-sized avatar

Robert Schönthal digitalkaoz

View GitHub Profile
export PATH=/Users/martins/bin:/opt/local/libexec/gnubin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:$PATH
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
# append to the history file, don't overwrite it
@ZauberNerd
ZauberNerd / critical-selectors.js
Created March 11, 2014 09:39
Extract all matching selectors for elements above-the-fold.
/* jslint browser:true, devel:true */
(function () {
'use strict';
if (typeof Element.prototype.matches !== 'function') {
var proto = Element.prototype;
var matches = proto.matches ||
proto.webkitMatchesSelector ||
proto.mozMatchesSelector ||
@jwage
jwage / .php_cs
Last active September 5, 2024 00:20
php-cs-fixer git pre commit hook
<?php
return Symfony\CS\Config\Config::create()
->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL)
->fixers([
'short_array_syntax',
'ordered_use',
])
;
@usefulthink
usefulthink / .bashrc
Last active August 17, 2017 14:06
automatically add current node-binary path to $PATH
LAST_PWD=""
LAST_NPM_BIN=""
# find the npm binary path for a given directory ($1).
# Mostly equivalent to calling `npm bin` (except it doesn't report
# non-existing directories), but around 40x faster.
function fastNpmBin() {
local dir="${1}"
local candidate=""
while [ "${dir}" != "/" ] ; do