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
// Shortcuts | |
var doc = app.activeDocument; | |
var selection = doc.selection; | |
function main() { | |
var outputFolder = Folder.selectDialog( 'Select folder for extracted objects.', '~' ); | |
if(!outputFolder) { | |
alert('You have to select a folder to save the files to!\nExiting.'); | |
return; |
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 | |
# It's still a bit quick and dirty, and is only tested on Snow Leopard. | |
adium_sound_settings_path="/Users/$USER/Library/Application Support/Adium 2.0/Users/Default/Sounds.plist" | |
temp_file_path="/tmp/muteadium_tmp.xml" | |
if [ ! -r "$adium_sound_settings_path" -a ! -w "$adium_sound_settings_path" ]; then | |
echo "Unable to read/write settings file." | |
exit 1 |
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
/src | |
/documents | |
/articles | |
/gallery | |
/de | |
/articles | |
/gallery | |
/es | |
/articles | |
/gallery |
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
mkdir associated-files && cd $_ | |
find ../source/html/documents/collection -type f -mindepth 3 | gsed -e 's/\/[a-z]\+\///g' | cut -d'/' -f2 | cut -d'.' -f1 | xargs mkdir |
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
//From http://stackoverflow.com/a/8396318/657977 | |
Switch [NAME] for whatever name you want to call it | |
Switch [PATH or URL] for the path or url to the repo you want to include. | |
git remote add [NAME]_remote [PATH or URL] | |
git fetch [NAME]_remote | |
git merge -s ours --no-commit [NAME]_remote/master | |
git read-tree --prefix=[NAME]/ -u [NAME]_remote/master | |
git commit -m "Imported [NAME] as a subtree." |
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
from random import random | |
from hashlib import md5 | |
generate_nonce = lambda: md5(str(random())).hexdigest() | |
# How to: | |
# 1. Call the generate_nonce function: | |
print generate_nonce() |
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
Show hidden characters
/* | |
User settings (shouldn't be overwritten on update) | |
*/ | |
[ | |
//Scroll down 10 rows | |
{ "keys": ["ctrl+up"], "command": "scroll_lines", "args": {"amount": 10.0} }, | |
{ "keys": ["ctrl+down"], "command": "scroll_lines", "args": {"amount": -10.0} }, | |
//Switch view by tab order | |
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }, |
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
//Source | |
loadScript = (function(document, tagName) { | |
var scriptElement = document.getElementsByTagName(tagName)[0]; | |
return function(url) { | |
var element = document.createElement(tagName); | |
element.src = element.async = url; | |
scriptElement.parentNode.insertBefore(element, scriptElement); | |
} | |
}(document, 'script')); |
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
Remove ._*- and .AppleDouble-files from folders. | |
Adapted from Torkel's comment on http://hints.macworld.com/article.php?story=20021118060850652 | |
Cred to hiber for suggesting adding -print0/-0 to solve whitespace issue. | |
See all ._*-files: | |
find . -name '._*' | more | |
Remove all ._*-files: | |
find . -name '._*' -print0 | xargs -0 rm |
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
<a class="button icon clock run">run code</a> | |
var el = document.createElement('a'); | |
el.setAttribute('class', 'button icon clock run'); | |
el.innerHTML = 'run code'; | |
document.body.appendChild(el); | |
NewerOlder