Skip to content

Instantly share code, notes, and snippets.

View ianthekirkland's full-sized avatar

Ian Kirkland ianthekirkland

View GitHub Profile
@ianthekirkland
ianthekirkland / wp_mangler.rb
Created August 12, 2012 01:05 — forked from ttscoff/wp_mangler.rb
wp_mangler: runs a replace on WordPress post content
#!/usr/bin/env ruby
# Requires 'sequel' and 'mysql' rubygems
require 'rubygems'
require 'sequel'
require 'cgi'
def e_sql(str)
str.to_s.gsub(/(?=[\\])/, "\\")
end
@ianthekirkland
ianthekirkland / Example for Team
Created August 12, 2012 01:06
Browser & Device detection
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>YOUR COMPANY</title>
<link media="all" rel="stylesheet" type="text/css" href="css/all.css">
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/jquery.main.js"></script>
<!--[if lt IE 8]><link rel="stylesheet" type="text/css" href="css/ie.css" /><![endif]-->
<script type="text/javascript">//<![CDATA[

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
@ianthekirkland
ianthekirkland / fb_jk_scroll.user.js
Created August 12, 2012 01:13 — forked from horimislime/fb_jk_scroll.user.js
Scrolls Facebook wall posts with j/k key
// ==UserScript==
// @name fb_jk_scroll
// @version 0.1
// @description Scrolls wall posts with j/k key
// @include http://www.facebook.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
// ==/UserScript==
$(document).ready(function(){
@ianthekirkland
ianthekirkland / pyget2.py
Created August 12, 2012 02:25 — forked from sajithdilshan/pyget2.py
A python download accelerator
#!/usr/bin/env python
#
# pyget2.py
# A python download accelerator
#
# This file uses multiprocessing along with
# chunked/parallel downloading to speed up
# the download of files (if possible).
#
# @author Benjamin Hutchins
@ianthekirkland
ianthekirkland / gist:3912595
Created October 18, 2012 15:33 — forked from michaelcpuckett/gist:3912558
brace expansion with mkdir
mkdir -p {test1,test2}/{test3,test4}
gives me test1/test3, test1/test4, test2/test3 and test2/test4
mkdir -p {test1,test2}/{test3,test4/{test5,test6}}
@ianthekirkland
ianthekirkland / snap.sh
Created December 15, 2012 17:27 — forked from anonymous/snap.sh
Apple Store Picture Taker
FILENAME=/Users/apple/Desktop/`date "+%c"`.jpg
#echo $FILENAME
/Users/apple/Downloads/ImageSnap-v0.2.5/imagesnap "$FILENAME"
@ianthekirkland
ianthekirkland / gist:4625644
Created January 24, 2013 17:45 — forked from than/gist:3919174
Simplenote in Menubar
/* -------------------------------------------------
SIMPLENOTE IN YOUR MENUBAR / FLUID.APP USERSTYLES
Than Tibbetts
http://thanland.com/notes/put-simplenote-in-your-menubar-with-fluid
------------------------------------------------- */
.wrapper { top: 20px !important; height: 92%; }
.sidebar { float: left; width: 100% !important; height: 50%; background: none !important; border-right: none !important; border-bottom: 2px solid rgba(0, 0, 0, 0.398438); border-bottom-left-radius: 0 !important; }
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'
@ianthekirkland
ianthekirkland / yaml-to-plist.rb
Created April 6, 2016 00:31 — forked from kch/yaml-to-plist.rb
Writes ruby object structures to plists. When called directly, takes a YAML file.
#!/usr/bin/env ruby
# encoding: UTF-8
require 'yaml'
require 'rexml/document'
class PlistWriter
PLIST_STUB_DOC = %q[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"></plist>]