Skip to content

Instantly share code, notes, and snippets.

@chmurph2
chmurph2 / copyURLPlusSafari.scpt
Created February 26, 2009 01:12
In Safari, this applescript copies the title and URL of the current tab to the clipboard.
-- In Safari, this copies the Title and URL of the current tab to the clipboard.
-- Save the script in ~/Library/Scripts/Applications/Safari
-- Using QuickSilver, I assign a trigger to this script using the hotkey ⌥-C (option c), with the scope of the trigger limited to Safari.
-- Inspired by CopyURL + (http://copyurlplus.mozdev.org/)
-- Christopher R. Murphy
tell application "Safari"
set theURL to URL of front document
set theTitle to name of front document
set the clipboard to theTitle & return & theURL as string
@mkhl
mkhl / path_helper.patch
Created June 4, 2009 08:53
Patch to `/usr/libexec/path_helper` to prevent hangs with long `PATH`s
Patch to `/usr/libexec/path_helper` to prevent hangs with long `PATH`s.
--- path_helper_bak 2009-05-07 15:54:37.000000000 +0200
+++ path_helper 2009-06-04 10:51:39.000000000 +0200
@@ -15,7 +15,7 @@
for f in "$DIR" "$DIR".d/* ; do
if [ -f "$f" ]; then
for p in $(< "$f") ; do
- [[ "$NEWPATH" = *(*:)${p}*(:*) ]] && continue
+ egrep -q "(^|${SEP})${p}($|${SEP})" <<<"$NEWPATH" && continue
[ ! -z "$NEWPATH" ] && SEP=":"
//Note: This command was automatically generated by the create-bookmarklet-command command.
CmdUtils.makeBookmarkletCommand({
name: "add-to-twine",
url: "javascript:(function(){var%20d=document,w=window,l=d.location,e=encodeURIComponent;if(!d.getElementById('rdr-script'))try{var%20s=d.createElement('script');s.type='text/javascript';s.id='rdr-script';s.src='http://www.twine.com/js/spotthis.js';(d.body||d.documentElement).appendChild(s);}catch(x){var%20p='?u='%20+e(l.href)%20+'&t='+e(d.title)%20+'&v=3',u='http://www.twine.com/bookmark/basic'+p;l.href=u%20+'&adv=1';}})()"
});
//Note: This command was automatically generated by the create-bookmarklet-command command.
CmdUtils.makeBookmarkletCommand({
name: "clip-to-evernote",
@hinrik
hinrik / replaygain-id3
Created January 5, 2010 02:24
Add ReplayGain information to id3 tags of mp3 files
#!/usr/bin/env perl
use strict;
use warnings;
use File::Which;
use Getopt::Long qw(:config auto_help);
use Pod::Usage;
use String::ShellQuote;
my $VERSION = '0.01';
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars
@seandenigris
seandenigris / gist:322074
Created March 4, 2010 20:28
Syntax highlight files in Quicklook
# Snippet to syntax-highlight source code files matching a certain pattern in Quicklook
# See see http://seandenigris.com/?p=412 for more info for more info
# Used with the qlcolorcode plugin
# Insert into QLColorCode.qlgenerator/Contents/Resources/colorize.sh
# Works for files in languages known to highlight (see qlcolorcode docs), but because of their filename, aren't recognized by Quicklook
#The commented lines are already in the file
#
# debug Handling special cases
> Jason Berberich's Custom Quix Commands
> REMARKS: Subject to change, obviously.
> GITHUB: http://github.com/berberich/quix-berberich
> MORE: http://quixapp.com
@Jason Berberich's Custom Quix Commands
author javascript:(function(){var url = document.location;var links = document.getElementsByTagName('link');var spans = document.getElementsByClassName('fn');var canonical = 'none';for (var i = 0, l; l = links[i]; i++){if (l.getAttribute('rel') == 'canonical'){canonical = l.getAttribute('href');break;}}var plusid = canonical.replace('https://plus.google.com/','');var name = spans[0].innerText.replace(' ','+');location.href='http://www.google.com/search?tbs=ppl_ids:--'+plusid+'-,ppl_nps:'+name;})(); Google Author Search
down http://downforeveryoneorjustme.com/%d Is this site downforeveryoneorjustme?
eye javascript:void(window.open('http://tineye.com/search?pluginver=bookmark_1.0&url='%20+%20encodeURIComponent(document.URL))); TinyEye: Where's this image from?
typekit javascript:(function(){s=doc
@dylansm
dylansm / quix.txt
Created April 11, 2010 03:25
quix.txt
pbs http://pinboard.in/search/?mine=Search+Mine&query=%s Pinboard search
pb javascript:if(document.getSelection){s=document.getSelection();}else{s='';};document.location='http://pinboard.in/add?next=same&url='+encodeURIComponent(location.href)+'&description='+encodeURIComponent(s)+'&title='+encodeURIComponent(document.title); Add Pinboard Bookmark
sw http://www.sweetwater.com/store/search.php?s=%s Sweetwater Search
read javascript:(function(){readStyle='style-newspaper';readSize='size-medium';readMargin='margin-wide';_readability_script=document.createElement('SCRIPT');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_readability_script);_readability_css=document.createElement('LINK');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_readability_css.
Adobe Flash LSO (Local Shared Objects) are like super-cookies that never expire and cannot be removed by browsers.
The Flash plugin installed in your system allows sites to write/share sensitive informations on your hard disk.
These are the simple info I currently have on how to make folders immutable on *NIX OS (Mac and Linux).
I have not been able to make immutable folders on my Windows XP VM maybe because I only use FAT32.
It seems that Windows allows you to lock files and folders on NTFS volumes only (I miss the info).
The following are the location of the folder that should be made immutable on each OS,
#!/usr/bin/env ruby -rjcode -Ku
# TaskPaper to Markdown converter
# Usage: tp2md.rb filename.taskpaper > output.md
require 'ftools'
infile = ARGV[0]
title = File.basename(infile,'.taskpaper').upcase
output = "# #{title} #\n\n"
prevlevel = 0
begin