Skip to content

Instantly share code, notes, and snippets.

View twitchy's full-sized avatar

Reeve Jolliffe twitchy

View GitHub Profile
@twitchy
twitchy / system-nobounce.txt
Created January 20, 2014 17:14
Prevent bouncing dock icon nag alert
defaults write com.apple.dock no-bouncing -bool TRUE
killall Dock
@twitchy
twitchy / 0_reuse_code.js
Created November 7, 2013 21:41
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
@twitchy
twitchy / blockquote.css
Created February 15, 2013 21:02
Simple blockquote
blockquote {
background:#f9f9f9;
border-left:10px solid #ccc;
margin:1.5em 10px;
padding:.5em 10px;
quotes:"\201C""\201D""\2018""\2019";
}
blockquote:before {
color:#ccc;
content:open-quote;
@twitchy
twitchy / flip.css
Created February 15, 2013 20:33
css flip
.flip {
-moz-transform: scaleX(-1);
-o-transform: scaleX(-1);
-webkit-transform: scaleX(-1);
transform: scaleX(-1);
@twitchy
twitchy / text-selection.css
Created February 15, 2013 20:37
change default text selection
::selection {
background-color: #dd2020;
color: #fff;
}
::-moz-selection {
background-color: #dd2020;
color: #fff;
}
@twitchy
twitchy / mac-dnsflush
Created November 22, 2014 02:36
Flush Yosemite DNS caches
sudo discoveryutil mdnsflushcache;sudo discoveryutil udnsflushcaches;say flushed
@twitchy
twitchy / wordpress-tags.php
Created June 24, 2014 16:17
wordpress-tags
<h3>Random remix tag cloud:</h3>
<?php wp_tag_cloud('number=50&format=list&order=RAND'); ?>
<h3>Most common tags:</h3>
<?php wp_tag_cloud('number=50&format=list&orderby=count'); ?>
<h3>All <?php if (function_exists('tagstats')) { tagstats(); } ?> tags in alphabetical order:</h3>
<?php wp_tag_cloud('smallest=10&largest=10&number=0&format=list'); ?>
@twitchy
twitchy / gulpfile.js
Last active August 29, 2015 14:02
gulpfile-wordpress-themedev
var gulp = require('gulp');
// Include Our Plugins
var jshint = require('gulp-jshint');
var compass = require('gulp-compass');
var minifyCSS = require('gulp-minify-css');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var rev = require('gulp-rev');
@twitchy
twitchy / for-loop-optimized.js
Created June 11, 2014 21:27
Optimized for loop
var len = thing.length;
for( var i = len; i--; ) {
// stuff
}
@twitchy
twitchy / dispatchTables.js
Created June 11, 2014 05:07
Dispatch Tables
var thingsWeCanDo = {
doThisThing : function() { /* behavior */ },
doThatThing : function() { /* behavior */ },
doThisOtherThing : function() { /* behavior */ },
default : function() { /* behavior */ }
};
var doSomething = function(doWhat) {
var thingToDo = thingsWeCanDo.hasOwnProperty(doWhat) ? doWhat : "default"
thingsWeCanDo[thingToDo]();