Skip to content

Instantly share code, notes, and snippets.

@conspirator
conspirator / gist:6152245
Last active December 20, 2015 15:09
# iTerm Colors 1. Download Gist 2. Rename to `webb.itermcolors` 3. Double click renamed file to install 4. Under Profiles > Colors, select "webb" preset
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
<?php
// Writes the appropriate #leftnav menu based on page id
$current_page_id = get_the_ID();
$amenities_sub_nav_pages = array(34, 63);
if (in_array($current_page_id, $amenities_sub_nav_pages)) {
wp_nav_menu(array(
'container' => 'false',
'menu' => 'amenities-sub-nav',
'menu_id' => 'leftnav'
));
@conspirator
conspirator / a.js
Last active December 22, 2015 23:29
!function(b) {
var a = function(d, c, f) {
if (f) {
f.stopPropagation();
f.preventDefault()
}
this.$element = b(d);
this.$newElement = null;
this.button = null;
this.options = b.extend({}, b.fn.selectpicker.defaults, this.$element.data(), typeof c == "object" && c);
tweetbot:///search?query=[[draft]]%20lang%3Aen%20-filter%3Aretweet%20-%22RT%20%22
@conspirator
conspirator / gif.sh
Last active December 31, 2015 19:49
#!/bin/sh
#
# Grab a random gif from giphy.com
#
# Example:
# $ gif // places a gif url on your clipboard
# $ gif -o // opens a gif url in your default browser
# $ gif chicago+bulls // places a Bulls-related gif url on your clipboard
# $ gif chicago+bulls -o // opens a Bulls-related gif url in your default browser
#
@conspirator
conspirator / gist:8996839
Created February 14, 2014 06:55
AVSpeechUtterance
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"I'm watching you"];
[utterance setRate:0.1666];
[utterance setPitchMultiplier:0.55];
[[[AVSpeechSynthesizer alloc] init] speakUtterance:utterance];
jQuery(function(){
if (window.matchMedia) {
if (window.matchMedia("(max-device-width: 480px)").matches) {
//
// Swaps in new mobile src for existing images
// Expects: <img class="mobile-src-overwrite-400" src="path/to/asset?parms=1" width="800">
// Returns: <img class="mobile-src-overwrite-400" src="path/to/asset-mobile?fmt=png-alpha&wid=400&qlt=95" width="400">
//
jQuery('[class*="mobile-src-overwrite-"]').each(function(){
jQuery(function(){
if (window.matchMedia) {
if (window.matchMedia("(max-device-width: 480px)").matches) {
jQuery('.mobile-src').each(function(){
var $el = jQuery(this),
newSrc = $el.attr('src').split('?')[0] + "-mobile?fmt=png-alpha&qlt=95";
jQuery('<img>', {
'src': newSrc,
'load': function(){
@conspirator
conspirator / yo.sh
Created July 28, 2014 07:35
Create numbered watermarked images via the command line ( ImageMagick )
for i in {1..25}; do convert original.jpg -font Helvetica -pointsize 200 -draw "gravity center fill white text 0,20 '$i'" water-marked-image-$i.jpg; done
@conspirator
conspirator / .gitignore
Last active August 29, 2015 14:05
Gitignore template
# Mac\n
.DS_Store\n\n
# Sass\n
.sass-cache/\n\n
# Node\n
node_modules\n
node_modules/\n
npm-debug.log