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
#!/usr/bin/env bash | |
# Will create a table in JIRA markup from a tab-delimited copy-paste buffer from | |
# SequelPro so you can embed a SQL query results easily in a JIRA ticket in table | |
# form. | |
pbpaste | tr '\t' '|' | sed 's/^/|/' | sed 's/$/|/' | pbcopy |
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
# NOTE: the hide('warnings', 'running', 'stdout', 'stderr') quiets the | |
# dumping of the commands fabric runs and its responses, which I find | |
# rather annoying. | |
def is_running(pidfile, pidpath): | |
with cd(pidpath): | |
if exists(pidfile): | |
with settings(hide('warnings', 'running', 'stdout', 'stderr'), warn_only=True): | |
return run('ps -p $(cat %s) --no-header' % pidfile).succeeded | |
else: |
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
package main | |
import "fmt" | |
import "time" | |
func consume(c chan int) { | |
for { | |
fmt.Println("sleeping for a second...") | |
time.Sleep(1000 * time.Millisecond) | |
fmt.Println("consumed:", <-c) |
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
package main | |
import "fmt" | |
import "net/http" | |
import "io/ioutil" | |
import "encoding/json" | |
func main() { | |
resp, err := http.Get("https://graph.facebook.com/sproutsocialinc") |
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
/** | |
* Black magic to tell sbt to choose the first duplicate class when resolving dependency collisions instead of just | |
* failing out. | |
*/ | |
mergeStrategy in assembly <<= (mergeStrategy in assembly) { | |
(old) => { | |
case x if Assembly.isConfigFile(x) => | |
MergeStrategy.concat | |
case PathList(ps@_*) if Assembly.isReadme(ps.last) || Assembly.isLicenseFile(ps.last) => | |
MergeStrategy.rename |
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 argparse | |
import mmap | |
import random | |
def get_line_count(filename): | |
linecount = 0 | |
with open(args.filename, "r+b") as f: | |
mm = mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ) |
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
" version control blame of selected lines | |
"vmap <Leader>b :<C-U>!svn blame <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p <CR> | |
vmap <Leader>g :<C-U>!git blame <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p <CR> | |
vmap <Leader>h :<C-U>!hg blame -fu <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p <CR> |
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
// Main.scala | |
class C { | |
var x = 0 | |
} | |
object Main extends App { | |
val c = new C() | |
println("c = " + c.x) | |
} |
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
#!/usr/bin/env bash | |
# N.B. requires patch queues (mq) enabled in your .hgrc. to finish this up | |
# and turn into a real commit, do `hg qfinish -a` | |
now=`date +"%s"` | |
patch_name='$now-temporary' | |
hg qnew $patch_name | |
hg qpop |
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
#!/usr/bin/env bash | |
open -a /Applications/IntelliJ\ IDEA\ 13\ CE.app/ pom.xml | |
# best as a bash alias :) |
OlderNewer