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
//twtplus | |
//Forked from: http://sites.google.com/site/coosgadgets/2ii | |
//Cleared out hacks, refactored code | |
//Additional features: | |
//*Shorten all urls in a post | |
//*d message with friend username autocompletion | |
//*Post as specified user using "as" modifier | |
//Visit for more explanation: http://damienh.org/2009/03/02/twtplus-the-missing-twitter-command-for-ubiquity-and-firefox/ | |
twitter_template = "\ |
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
public class MyAction extends ActionSupport implements TemplateMethodModel { | |
/*Your functionality here */ | |
/** | |
* when you need to display a localized piece of text in | |
* the ftl just use ${text("some.property.name")} | |
* there should be a package.properties or ClassName.properties | |
* file in the same source package directory as the Action that | |
* will be using them. There *is* a way to set a global properties file |
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
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo -e " \xE2\x98\xA2" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" | |
} | |
export PS1='\[\033[01;32m\]\w $(git branch &>/dev/null; if [ $? -eq 0 ]; | |
then echo "\[\033[01;34m\]$(parse_git_branch)"; fi) \$ \[\033[00m\]' |
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 the following to your ~/.bashrc to open any markdown file in Marked | |
# usage: marked my_markdown_file.md | |
# this will work the next time you launch a terminal or refresh your shell. | |
function marked { | |
open -a Marked $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
# I wanted a way to combine bundle list with bundle show so that i could show | |
# the location of all the gems bundlr was managing. | |
# this does it (at least on unix / OS X ) | |
# The first line is always an error message from bundlr because the first line of | |
# bundle list's output is "Gems included by the bundle:" which, obviously | |
# isn't a valid gem name. | |
bundle list | perl -pi -e 's/\s+\*\s(\S+)\s+.*/$1/' | while read line ; do bundle show $line ; done | |
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
set ww+=<,> | |
" making arrow keys wrap across line breaks in normal mode | |
imap <Left> <C-O><Left> | |
imap <Right> <C-O><Right> | |
set noexpandtab | |
set copyindent | |
set preserveindent | |
set softtabstop=0 | |
set tabstop=4 |
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
Dear soon-to-be-former user, | |
We've got some fantastic news! Well, it's great news for us anyway. You, on | |
the other hand, are fucked. | |
We've just been acquired by: | |
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
/** | |
* svbtle kudos | |
*/ | |
.kudos { | |
margin: 300px; | |
width: 40px; | |
height: 40px; | |
border: 4px solid black; |
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
import re | |
def markdown_to_bbcode(s): | |
links = {} | |
codes = [] | |
def gather_link(m): | |
links[m.group(1)]=m.group(2); return "" | |
def replace_link(m): | |
return "[url=%s]%s[/url]" % (links[m.group(2) or m.group(1)], m.group(1)) | |
def gather_code(m): |
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
$ curl https://api.github.com/zen | octocatsay | |
MMM. .MMM | |
MMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMM ______________________________ | |
MMMMMMMMMMMMMMMMMMMMM | | | |
MMMMMMMMMMMMMMMMMMMMMMM | Practicality beats purrrity. | | |
MMMMMMMMMMMMMMMMMMMMMMMM |_ __________________________| | |
MMMM::- -:::::::- -::MMMM |/ | |
MM~:~ ~:::::~ ~:~MM |
OlderNewer