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 collections import deque | |
from django.db import models | |
class MethodCalls(object): | |
""" | |
A mock object which logs chained method calls. | |
""" | |
def __init__(self): |
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
_s() { | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
if [[ $COMP_CWORD -eq 1 ]]; then | |
opts=($S_BIN_PATH/*) | |
basenames="${opts[@]##*/}" | |
COMPREPLY=( $(compgen -W "${basenames[@]}" -- $cur) ) | |
fi | |
} |
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
root@a7a97c4c4034:/opt/docker-volumes# GOOS=darwin GOARCH=amd64 ./make.sh | |
package github.com/docker/docker/archive | |
imports github.com/docker/docker/archive | |
imports github.com/docker/docker/archive: cannot find package "github.com/docker/docker/archive" in any of: | |
/usr/src/go/src/pkg/github.com/docker/docker/archive (from $GOROOT) | |
/go/src/github.com/docker/docker/archive (from $GOPATH) | |
export.go:11:2: cannot find package "github.com/docker/docker/archive" in any of: | |
/usr/src/go/src/pkg/github.com/docker/docker/archive (from $GOROOT) | |
/go/src/github.com/docker/docker/archive (from $GOPATH) |
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 xmltopdf; | |
import com.itextpdf.text.BaseColor; | |
import com.itextpdf.text.DocumentException; | |
import com.itextpdf.text.Element; | |
import com.itextpdf.text.Font; | |
import com.itextpdf.text.Image; | |
import com.itextpdf.text.Phrase; | |
import com.itextpdf.text.Rectangle; | |
import com.itextpdf.text.pdf.PdfPCell; |
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
def d(fn): | |
def fn_(*args): | |
print fn(*args) | |
return fn_ | |
fs = { | |
(False, True): d(lambda _: 'fizz'), | |
(True, False): d(lambda _: 'buzz'), | |
(False, False): d(lambda _: 'fizzbuzz'), |
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
trebVoiceTwo = | |
#(define-music-function | |
(parser location note) | |
(ly:music?) | |
#{ | |
\relative c' { r16 $note 8.~ $note 4 r16 $note 8.~ $note 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
# | |
# Installation: | |
# | |
# - Save me at ~/.irssi/scripts/notify.pl | |
# | |
# - In ~/.irssi/scripts: | |
# 1. $ mkdir autorun | |
# 2. $ cd autorun | |
# 3. $ ln -s ../notify.pl notify.pl | |
# |
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 | |
# Custom move command that will create the destination directory if it does not | |
# exist. | |
function my_mv() { | |
# If two arguments were passed and the first argument was a file that exists | |
if [[ $# == 2 && -e $1 ]] | |
then | |
# Get the directory name of the second argument ("testing/test.txt" -> | |
# "testing") |
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
/*global _:true */ | |
/** | |
* Args builds an object with a property for each query argument in the query | |
* portion of a url. Properties on the object can then be modified and an | |
* updated url with query string can be produced from the Args instance. | |
*/ | |
function Args(url) { | |
var self = this; |
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/sh | |
formail -D 10000000 idcache < "$1" -s > ztmp && mv ztmp "$1" | |
rm idcache |
OlderNewer