Skip to content

Instantly share code, notes, and snippets.

@cfg
cfg / jquery-deparam.js
Created June 18, 2013 19:25
jquery-deparam: deparam function separated from jQuery BBQ v1.3pre by Ben Alman http://benalman.com/projects/jquery-bbq-plugin/
/*jslint browser: true, ass: true, eqeq: true, forin: true, newcap: true, nomen: true, plusplus: true, regexp: true, unparam: true, sloppy: true, todo: true, vars: true, white: true */
/*!
* jquery-deparam: deparam function separated from jQuery BBQ v1.3pre by Ben Alman
* http://benalman.com/projects/jquery-bbq-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
// Project Home - http://benalman.com/projects/jquery-bbq-plugin/
@cfg
cfg / gist:5822755
Created June 20, 2013 13:39
wordpress admin dashboard - hooks and filters (common/useless ones removed)
filter : option_siteurl
filter : option_home
filter : option_siteurl
filter : option_blog_charset
action : plugins_loaded
filter : plugins_url
filter : default_option_embed_autourls
action : jetpack_modules_loaded
filter : jetpack_enable_open_graph
action : sanitize_comment_cookies
@cfg
cfg / gist:5823017
Created June 20, 2013 14:07
wordpress admin edit.php - hooks and filters (common/useless ones removed)
filter : option_siteurl
filter : option_home
filter : option_siteurl
filter : option_blog_charset
action : plugins_loaded
filter : plugins_url
filter : default_option_embed_autourls
action : jetpack_modules_loaded
filter : jetpack_enable_open_graph
action : sanitize_comment_cookies
@cfg
cfg / gist:6221080
Created August 13, 2013 13:30
CrashPlan admin excludes, located in /Library/Application Support/CrashPlan/conf/my.service.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<config id="service" modified="2013-08-13T07:32:57:739-0500" version="4">
<serviceBackupConfig>
<backupConfig>
<excludeSystem>
<patternList>
<pattern regex=".*/(?:42|\d{8,}).*/(?:cp|~).*"/>
<pattern regex="(?i).*/CrashPlan.*/(?:cache|log|conf|manifest|upgrade)/.*"/>
<pattern regex=".*\.part"/>
<pattern regex=".*/iPhoto Library/iPod Photo Cache/.*"/>
@cfg
cfg / sqlite_backup.py
Created August 13, 2013 15:44
Hot copy an sqlite DB. Used in an attempt to safely backup my Chrome cookies since CrashPlan excludes them. Forgive any python ugliness.
#! /usr/bin/env python
"""
Perform an online backup of a sqlite database using the backup API.
See: http://www.sqlite.org/backup.html
https://github.com/husio/python-sqlite3-backup
"""
from __future__ import print_function
import sys
@cfg
cfg / gist:6242453
Last active December 21, 2015 03:29
Patch for https://github.com/aelliott/expressioneditor CMakeLists.txt to search for the ICU lib in /usr/local/opt/icu4c where homebrew installs it.
--- orig/CMakeLists.txt 2013-08-15 11:43:06.000000000 -0500
+++ patched/CMakeLists.txt 2013-08-15 11:47:43.000000000 -0500
@@ -6,10 +6,13 @@
PROJECT(expressioneditor)
# The version number.
SET(expressioneditor_VERSION_MAJOR 0)
SET(expressioneditor_VERSION_MINOR 1)
+set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /usr/local/opt/icu4c/lib)
+set(CMAKE_INCLUDE_PATH ${CMAKE_LIBRARY_PATH} /usr/local/opt/icu4c/include)
@cfg
cfg / CMakeLists.txt.patch
Created August 15, 2013 17:04
Patch for https://github.com/aelliott/expressioneditor CMakeLists.txt to search for the ICU lib in /usr/local/opt/icu4c where homebrew installs it. Apply with: $ cd /path/to/expressioneditor/ $ curl -s https://gist.github.com/cfg/6242556/raw | patch -p1 --verbose
--- orig/CMakeLists.txt 2013-08-15 11:43:06.000000000 -0500
+++ patched/CMakeLists.txt 2013-08-15 11:47:43.000000000 -0500
@@ -6,10 +6,13 @@
PROJECT(expressioneditor)
# The version number.
SET(expressioneditor_VERSION_MAJOR 0)
SET(expressioneditor_VERSION_MINOR 1)
+set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /usr/local/opt/icu4c/lib)
+set(CMAKE_INCLUDE_PATH ${CMAKE_LIBRARY_PATH} /usr/local/opt/icu4c/include)
@cfg
cfg / gist:6244326
Created August 15, 2013 20:07
Install in /usr/local/bin/notify-compass and chmod +x it
#!/bin/bash
BASE="/path/to/compass_root_dir"
FILE="$1"
LINE="$2"
shift
shift
/usr/local/bin/growlnotify --image /path/to/a/pretty/compass.ico -n compass-cli --url "subl://open/?file=$BASE/$FILE&line=$LINE" $*
@cfg
cfg / gist:6244347
Created August 15, 2013 20:09
Save as /usr/local/bin/handler-subl and use with https://gist.github.com/cfg/6244326
#!/usr/bin/env php -q
<?php
$subl = '/usr/local/bin/subl';
if( empty($argv[1]) )
exit(1);
$parts = parse_url( $argv[1] );
@cfg
cfg / osxutils.rb
Created August 20, 2013 15:57
Homebrew osxutils forumula. Modified to use the better trash util from http://hasseg.org/trash/
require 'formula'
class Osxutils < Formula
# begin cfg changes
# this `trash` is much better
depends_on 'trash'
# end cfg changes
homepage 'https://github.com/vasi/osxutils'
url 'https://github.com/vasi/osxutils/archive/v1.8.tar.gz'
sha1 'c3d20da36ecfae3abff07f482a572b3680a12b6d'