Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
case $1 in
*_EDITMSG|*MERGE_MSG|*_TAGMSG )
/usr/local/bin/vim $1
;;
*.md )
/usr/local/bin/mmdc $1
;;
*.txt )
#!/bin/bash
#
# This is free and unencumbered software released into the public domain.
#
# Requires bc, dc, openssl, xxd
#
# by grondilu from https://bitcointalk.org/index.php?topic=10970.msg156708#msg156708
base58=({1..9} {A..H} {J..N} {P..Z} {a..k} {m..z})
bitcoinregex="^[$(printf "%s" "${base58[@]}")]{34}$"
@tzarskyz
tzarskyz / Armory
Created April 1, 2013 00:25 — forked from colindean/Armory
#!/bin/bash
cd "${0%/*}"
export DYLD_LIBRARY_PATH=../Dependencies/QtCore.framework/Versions/Current:../Dependencies/QtGui.framework/Versions/Current:../Dependencies:$DYLD_LIBRARY_PATH
bin/python armorybuild/ArmoryQt.py &
Install and configure brew
$ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
$ touch ~/.bashrc
$ echo "export PATH=\`brew --prefix\`/bin:\`brew --prefix\`/share/python:\$PATH" >> ~/.bashrc
$ echo "export CFLAGS=\"-arch x86_64\"" >> ~/.bashrc
$ echo "export ARCHFLAGS=\"-arch x86_64\"" >> ~/.bashrc
$ source ~/.bashrc
$ brew doctor
Do what the doctor says! This will more than likely include installing XCode from the App Store and then installing the "Command line tools" from "Xcode > Preferences > Downloads"
@tzarskyz
tzarskyz / Armory
Created April 14, 2013 22:14 — forked from colindean/Armory
#!/bin/bash
cd "${0%/*}"
export DYLD_LIBRARY_PATH=../Dependencies/QtCore.framework/Versions/Current:../Dependencies/QtGui.framework/Versions/Current:../Dependencies:$DYLD_LIBRARY_PATH
bin/python armorybuild/ArmoryQt.py &
Install and configure brew
$ ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
$ touch ~/.bashrc
$ echo "export PATH=\`brew --prefix\`/bin:\`brew --prefix\`/share/python:\$PATH" >> ~/.bashrc
$ echo "export CFLAGS=\"-arch x86_64\"" >> ~/.bashrc
$ echo "export ARCHFLAGS=\"-arch x86_64\"" >> ~/.bashrc
$ source ~/.bashrc
$ brew doctor
Do what the doctor says! This will more than likely include installing XCode from the App Store and then installing the "Command line tools" from "Xcode > Preferences > Downloads"
on alfred_script(q)
set tmp to splitString(q, " ")
set q to item 1 of tmp
if length of tmp is 2 then
set change to item 2 of tmp
else
set change to 10
end if
set current to output volume of (get volume settings)
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEDIT REGULAR EXPRESSION GUIDE MODIFIED 2013-03-27 : 13:08
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE (Perl Compatible Regular Expressions) engine is what BBEdit uses.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
-- get path of Finder window
tell application "Finder"
try
set finder_window to window 1
on error
error "There are no Finder windows"
end try
set start_path to POSIX path of (target of window 1 as alias)
end tell
on replaceCommasInStringWithHTMLEntity(theTitle)
set rubyCommand to quote & "puts " & "'" & theTitle & "'" & ".gsub( /,/, ',' )" & quote
set strippedTitle to do shell script "ruby -e " & rubyCommand
return strippedTitle
end replaceCommasInStringWithHTMLEntity
on stripUTMFromURL(urlToStrip)
set rubyCommand to quote & "puts " & "'" & urlToStrip & "'" & ".gsub( /\\?utm.*$/, '' )" & quote
set strippedURL to do shell script "ruby -e " & rubyCommand
return strippedURL