- https://saml.github.io
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
"~/.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}) |
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
#!/bin/bash | |
HAXE_VERSION="3.2.0" | |
NEKO_VERSION="2.0.0" | |
PREFIX="${1:-$HOME/opt}" | |
NEKODIR="$PREFIX/neko" | |
HAXEDIR="$PREFIX/haxe" | |
echo "$PREFIX" |
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 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') |
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 | |
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 |
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
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] |
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
#!/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" |
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
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. |
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
from functools import wraps | |
class Foo(object): | |
def __init__(self): | |
self.dispatch = {} | |
self._default = None | |
def mimetype(self, a): | |
@wraps | |
def wrapped(fn): |
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
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 |
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 amqp | |
import amqp.basic_message | |
host=sys.argv[1] | |
filepath=sys.argv[2] | |
logging.basicConfig(level=logging.DEBUG) |