Skip to content

Instantly share code, notes, and snippets.

View ianthekirkland's full-sized avatar

Ian Kirkland ianthekirkland

View GitHub Profile
@ianthekirkland
ianthekirkland / Finder-ApplyColorLabelToSelectedItems.applescript
Created April 17, 2012 07:45
Apply color labels to selected Finder items; Ideal for assigning to hotkeys via a Launcher app such as "Keyboard Maestro", "Butler", or "Alfred".
-- Finder-ApplyColorLabelToSelectedItems
-- ©2011 Ian Kirkland, M.Ed, Kirkland Professional Studios
(*
I like to use Finder labels in conjunction with smart folders that point to files and/or folders of a specific label color. That way, I can use red labels for "urgent" to-do items, orange labels for "standard to-do", etc. This script allows a much quicker way of applying color labels.
LEGEND
-------------------------------------------------
Keystroke | Appearance | Label Index
-------------------------------------------------
key "0" = No color = 0
(*
http://blog.smilesoftware.com/category/user-tips/textexpander/
Here are a couple of sample scripts to get you started. The first one creates a new group and then creates two snippets within it:
*)
tell application “TextExpander”
–– create a new group
make new group with properties {name:”My New Script Group”}
set newGroup to the result
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
<title/>
<meta name="Author" content="Ian Kirkland, M.Ed"/>
<meta name="Company" content="Green Packaging Asia"/>
<meta name="Copyright" content="Green Packaging Asia"/>
<meta name="Generator" content="Cocoa HTML Writer"/>
<meta name="CocoaVersion" content="1038.36"/>
@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 / style-r1.css
Created August 29, 2012 11:57
cheaters_style_sheet
@font-face {
font-family:Inconsolata;
src:url(fonts/Inconsolata-webfont.woff) format(woff);
font-weight:400;
font-style:normal;
}
body {
-webkit-font-smoothing:antialiased;
font:normal .8764em/1.5em Arial,Verdana,sans-serif;
@ianthekirkland
ianthekirkland / sh-rename.txt
Created October 18, 2012 15:32
shell syntax
Move all files with names ending in ".jpg" from the current folder to the Documents directory.
$ mv *.jpg ~/Documents
____________________________
Move the "Documents" folder to "Documents backup". (quotes are needed because of the space in the folder name.)
$ mv Documents "Documents backup".
____________________________