This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove external class from links in code snippets: | |
// the *= means "match if the string contains this anywhere" | |
$('a[href*="github.com"]').removeClass("external"); | |
// We also need to remove the external class from our PDF links | |
// so that they have the right icon. | |
$('a[href$=".pdf"]').removeClass("external"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.pdf_link { | |
background: url(images/file_acrobat.gif) top right no-repeat; | |
padding-right:20px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add an Adobe Acrobat icon to links that lead to PDF files | |
// the $= means "match if the string ends with this" | |
$('a[href$=".pdf"]').addClass("pdf_link"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a[href^="http://"]').addClass("external").attr('target', '_blank'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('a[href^="http://"]') | |
.addClass("external") | |
.attr('target', '_blank') | |
.attr('title', 'Opens in New Window'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/System/Library/CoreServices/backupd.bundle/Contents/Resources/backupd-helper > /dev/null 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int addFunction( int a, int b ) { | |
return a + b; | |
} | |
int stringLength( char *str ) { | |
return strlen(str); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- read clipboard contents | |
set x to the clipboard | |
-- write to clipboard | |
set the clipboard to "some text" | |
-- restore previous contents | |
set the clipboard to x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Get Github Gist | |
Quicksilver Action | |
by Mike Green | |
Created on 2009-02-05 | |
*) | |
set githubUser to do shell script "/usr/local/bin/git config --global github.user" | |
set githubToken to do shell script "/usr/local/bin/git config --global github.token" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get & copy a Gist by ID | |
CmdUtils.CreateCommand({ | |
name: "gist-copy", | |
icon: "http://gist.github.com/favicon.ico", | |
author: {name: "Mike Green", email: "mike.is.green@gmail.com"}, | |
takes: {"gist": noun_arb_text}, | |
preview: function(pblock, theGist) { | |
var urlTemplate = "http://gist.github.com/${gist}.txt"; | |
var gistURL = CmdUtils.renderTemplate(urlTemplate, {gist: theGist.text}); | |
CmdUtils.previewGet(pblock, gistURL, {}, function(data) { |