This file contains hidden or 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
(ns ini.core | |
(:use [clojure.string :only [index-of last-index-of trim split-lines]] | |
[slingshot.slingshot :only [throw+]])) | |
(defn- section? | |
"Whatever the given string is a section or not" | |
[s] | |
(and | |
(= (first s) \[) | |
(= (last s) \]))) |
This file contains hidden or 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
key:"string value" | |
int_key:22 |
This file contains hidden or 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
#!/bin/sh | |
function pr() { | |
local repo=`git remote -v | grep -m 1 "(push)" | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"` | |
if [ -n "$repo" ]; then | |
local branch=`git name-rev --name-only HEAD` | |
echo "... creating pull request for branch \"$branch\" in \"$repo\"" | |
open https://github.com/$repo/pull/new/$branch | |
fi | |
} |
This file contains hidden or 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
// usage: $.initinput(); $.inputmap("pressed LEFT", function() { alert('pressed LEFT') }, null); | |
// or: $('div').inputmap("pressed ESCAPE", function() { alert('pressed ESCAPE') }); | |
// with $.install_esc_handler() you popups will be closed by ESCAPE. Popups are elements with 'popup' class and 'z-index' > 0 | |
$.extend({ | |
keyCodes:{8:'BACKSPACE', 9:'TAB', 13:'ENTER', 16:'SHIFT', 17:'CONTROL', 18:'ALT', 27:'ESCAPE', | |
33:'PG_UP', 34:'PG_DN', 35:'END', 36:'HOME', 37:'LEFT', 38:'UP', 39:'RIGHT', 40:'DOWN', | |
46:'DELETE', 91:'META', 0:'UNKNOWN'}, | |
repeatKeys:[ 37, 38, 39, 40 ], |
This file contains hidden or 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
(function ($) { | |
/** | |
* Disposer jQuery plugin. | |
* | |
* Adds 'disposed' event so you may execute some code _before_ element is somehow removed: | |
* | |
* $('.remove').bind('disposed', function() { | |
* // code to be executed | |
* }); | |
* |
This file contains hidden or 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
property extension_list : {"mp3"} | |
property destination_folder : (path to music folder as text) & "iTunes:iTunes Music:Automatically Add to iTunes:" | |
property this_action_path : (path to home folder as text) & "Library:Scripts:Folder Action Scripts:copy_to_itunes.scpt" | |
on adding folder items to this_folder after receiving added_items | |
set number_of_items to 0 | |
repeat with i from 1 to number of items in added_items | |
set this_file to item i of added_items | |
if folder of (info for this_file) is true then | |
tell application "System Events" |
This file contains hidden or 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
-- | |
-- simple AppleScript to convert chosen AVI files to iPhone video format one by one using QuickTime Player X | |
-- | |
property outputFolder : (path to movies folder as Unicode text) | |
on check_exists(fileToCheck) | |
repeat | |
tell application "Finder" | |
if exists file fileToCheck then | |
exit repeat |