Skip to content

Instantly share code, notes, and snippets.

View saml's full-sized avatar

Sam Lee saml

  • New York, NY
View GitHub Profile
"~/.vim/bundle/nerdtree/nerdtree_plugin/reuse_open_tab.vim
call NERDTreeAddKeyMap({
\ 'key': 't',
\ 'scope': 'FileNode',
\ 'callback': 'NERDTreeCustomOpenInTab',
\ 'quickhelpText': 'open in new tab reusing if able' })
function! NERDTreeCustomOpenInTab(node)
call a:node.open({'where': 't', 'reuse': 1})
#!/bin/bash
HAXE_VERSION="3.2.0"
NEKO_VERSION="2.0.0"
PREFIX="${1:-$HOME/opt}"
NEKODIR="$PREFIX/neko"
HAXEDIR="$PREFIX/haxe"
echo "$PREFIX"
import random
from functools import wraps
from flask import request, Flask, Blueprint, jsonify, make_response
def jsonp(f):
@wraps(f)
def wrapped(*args, **kwargs):
callback = request.args.get('callback')
import re
from flask import request, Flask, Blueprint, jsonify, g
NON_WORD = re.compile(r'\W+')
def slugify(x):
if x:
return NON_WORD.sub('-', x).lower()
return x
java.util.concurrent.ExecutionException: Boxed Error
at scala.concurrent.impl.Promise$.resolver(Promise.scala:52) ~[scala-library.jar:na]
at scala.concurrent.impl.Promise$.scala$concurrent$impl$Promise$$resolveTry(Promise.scala:44) ~[scala-library.jar:na]
at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:116) ~[scala-library.jar:na]
at scala.concurrent.Promise$class.complete(Promise.scala:55) ~[scala-library.jar:na]
at scala.concurrent.impl.Promise$DefaultPromise.complete(Promise.scala:58) ~[scala-library.jar:na]
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:23) ~[scala-library.jar:na]
#!/bin/bash
if (( $# < 3 ))
then
echo "Usage: $0 image mp3 output"
exit 1
fi
ffmpeg -loop 1 -i "$1" -i "$2" -shortest -acodec copy "$3"
when the rain falls down
and the music plays on my phone
then i remember the days you were here.
when the music flows
and the thought of you is in my head
then it rains out side always like this.
and the melody goes like this.
and the rhythm is dripping on my window.
from functools import wraps
class Foo(object):
def __init__(self):
self.dispatch = {}
self._default = None
def mimetype(self, a):
@wraps
def wrapped(fn):
from flask import app, Flask, jsonify, request
class ContentNegotiator(object):
def __init__(self):
self.supported = {}
self._default_renderer = None
def mimetype(self, content_type):
def decorator(fn):
self.supported[content_type] = fn
import amqp
import amqp.basic_message
host=sys.argv[1]
filepath=sys.argv[2]
logging.basicConfig(level=logging.DEBUG)