Skip to content

Instantly share code, notes, and snippets.

View masukomi's full-sized avatar

masukomi (a.k.a. Kay Rhodes) masukomi

View GitHub Profile
//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 = "\
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
@masukomi
masukomi / git_shell_prompt.sh
Created June 23, 2011 14:07
Modified prompt displaying current git branch and radiation symbol if the branch is dirty
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\]'
@masukomi
masukomi / open_in_marked.sh
Created December 3, 2011 18:15
opening Markdown files in Marked
# 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
}
@masukomi
masukomi / gist:1451438
Created December 9, 2011 12:59
bundle show all (for bundlr)
# 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
@masukomi
masukomi / .vimrc
Created December 21, 2011 14:36
masukomi's .vimrc
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
@masukomi
masukomi / gist:2344864
Created April 9, 2012 17:27 — forked from panicsteve/gist:1641705
Form letter template for acquired startups
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:
[ ] Facebook
[ ] Google
[ ] Twitter
@masukomi
masukomi / dabblet.css
Created May 2, 2012 04:31 — forked from weslly/dabblet.css
svbtle kudos
/**
* svbtle kudos
*/
.kudos {
margin: 300px;
width: 40px;
height: 40px;
border: 4px solid black;
@masukomi
masukomi / markdown_to_bbcode.py
Created July 16, 2012 20:13 — forked from sma/markdown_to_bbcode.py
Converts a subset of markdown into BBcode
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):
@masukomi
masukomi / octocat_zen.sh
Created November 14, 2012 18:38 — forked from pengwynn/octocat_zen.sh
GitHub Zen
$ curl https://api.github.com/zen | octocatsay
MMM. .MMM
MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMM ______________________________
MMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMMMMMM | Practicality beats purrrity. |
MMMMMMMMMMMMMMMMMMMMMMMM |_ __________________________|
MMMM::- -:::::::- -::MMMM |/
MM~:~ ~:::::~ ~:~MM