most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
My list of commonly used sites for web development
Tool | Address |
---|---|
Create Data URLs | http://dataurl.net/#about |
Desktop Browser Compatibility Tables For DOM Events | http://www.webbrowsercompatibility.com |
Can I Use | http://caniuse.com/ |
PHP Composer repository | https://packagist.org |
// returns true is browser is mobile | |
// added "|android|ipad|playbook|silk" to first regex to detect tablets | |
// This leaves 2 'android' tests in the first regex. One of the 'android' tests can be eliminated | |
// but left in so you can remove the "|android|ipad|playbook|silk" string easily. | |
function isMobile() { | |
var a = navigator.userAgent||navigator.vendor||window.opera; | |
if (/(android|bb\d+|meego|android|ipad|playbook|silk).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng) |
// credit Rolf Timmermans | |
// http://voormedia.com/blog/2012/11/responsive-background-images-with-fixed-or-fluid-aspect-ratios | |
/* Calculate fluid ratio based on two dimensions (width/height) */ | |
@mixin fluid-ratio($large-size, $small-size) { | |
$width-large: nth($large-size, 1); | |
$width-small: nth($small-size, 1); | |
$height-large: nth($large-size, 2); | |
$height-small: nth($small-size, 2); | |
$slope: ($height-large - $height-small) / ($width-large - $width-small); |
#!/bin/bash | |
set -o errexit | |
git filter-branch --tree-filter "git rm -r -f --ignore-unmatch *.psd" HEAD | |
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune |
// Marker, a bookmarklet for Markdownifying webpage selections | |
// javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading…</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://gist.github.com/ttscoff/8078727/raw/Marker.js?x="+(Math.random());})(); | |
(function () { | |
function callback() { | |
(function ($) { | |
var raw, userSelection; | |
if (window.getSelection) { | |
// W3C Ranges | |
userSelection = window.getSelection (); | |
// Get the range: |
#!/bin/sh | |
## | |
# Quick Look Plugins | |
# @url http://caskroom.io | |
# @brief Quick Look Plugins installed via Homebrew Cask | |
# | |
# For a comprehensive overview of Quick Look plugins look here: https://github.com/sindresorhus/quick-look-plugins | |
# | |
brew cask install qlcolorcode # Preview source code files with syntax highlighting | |
brew cask install qlstephen # Preview plain text files without a file extension. Example: README, CHANGELOG, etc. |
<?php | |
// returns the path of the request URI without the query string | |
// see http://php.net/manual/en/function.parse-url.php | |
// and http://php.net/manual/en/reserved.variables.server.php | |
// and http://php.net/manual/en/url.constants.php | |
$request_uri = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ); | |
$is_admin = strpos( $request_uri, '/wp-admin/' ); |
Please use these at your own risk. I cannot be responsible for having no idea what I am doing and breaking your server.
This is a collection of Apache configuration settings that I use in my ExpressionEngine projects. Since I have always been a big fan of the HTML5 Boilerplate I took inspiration from their .htaccess file and tweaked my configuration with other settings I have used over the years.
This gist contains:
Please use these at your own risk. I cannot be responsible for having no idea what I am doing and breaking your server.
This is a collection of Apache configuration settings that I use in my ExpressionEngine projects. Since I have always been a big fan of the HTML5 Boilerplate I took inspiration from their .htaccess file and tweaked my configuration with other settings I have used over the years.
This gist contains: