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 [ $# -gt 0 ]; then | |
echo | |
echo Removing trailing whitespace in $1 | |
echo | |
find $1 -type f -iname '*.[hm]' -exec gsed -i 's/[[:space:]]*$//' '{}' ';' | |
else | |
echo | |
echo Usage: | |
echo remove-trailing-whitespace [target-dir] |
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 bar(foo): | |
qux = foo | |
quux = foo[qux.baz] | |
# | |
# Error compiling Cython file: | |
# ------------------------------------------------------------ | |
# ... | |
# def bar(foo): |
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 python | |
import argparse | |
import os | |
import subprocess | |
def main(): | |
parser = argparse.ArgumentParser(description='Transcodes videos to DVD compatible MPEG-2 using mencoder') | |
parser.add_argument('file', help='Input file', nargs='+') | |
args = parser.parse_args() |
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 datetime import timedelta | |
def parseTimeDelta(s): | |
"""Create timedelta object representing time delta | |
expressed in a string. | |
""" | |
if s is None: | |
return None | |
d = re.match( |
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
# | |
# Dependencies: pssh, pdsh, cssh | |
# | |
# Under ~/.pssh/ I keep lists of hosts, one cluster per file, one hostname per line. | |
# | |
alias mssh='f() { hosts=$1; shift; for h in $(cat ~/.pssh/$hosts); do ssh $h $@ ; done }; f' | |
# auto-generate aliases for common host groups | |
for hostlist in $(ls ~/.pssh/); do |
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
#include <unistd.h> | |
#include <zmq.h> | |
int main (int argc, const char * argv[]) | |
{ | |
void *ctx = zmq_init (1); | |
void *pub = zmq_socket (ctx, ZMQ_PUB); | |
zmq_bind (pub, "tcp://*:4711"); |
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
#include <string.h> | |
#include <sys/time.h> | |
#include <unistd.h> | |
#include <zmq.h> | |
#define TOPIC "foobarfoobarfoobarfoobarfoobar" | |
int main (int argc, const char * argv[]) | |
{ |
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 org.cliffc.high_scale_lib.NonBlockingHashMap; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; | |
public class NonBlockingHashMapTest { | |
static class Progress extends Thread { | |
public volatile long operations; | |
public void run() { |
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 b00ab1a369c87e2cdcc29f178a337a20bf7fb07b Mon Sep 17 00:00:00 2001 | |
From: Daniel Norberg <[email protected]> | |
Date: Thu, 12 Jun 2014 19:55:42 -0400 | |
Subject: [PATCH] fix building on macosx | |
--- | |
pkg/libcontainer/namespaces/nsenter.go | 133 +-------------------------------- | |
1 file changed, 2 insertions(+), 131 deletions(-) | |
diff --git a/pkg/libcontainer/namespaces/nsenter.go b/pkg/libcontainer/namespaces/nsenter.go |
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
require "formula" | |
class Docker < Formula | |
homepage "http://docker.io" | |
url "https://github.com/dotcloud/docker.git", :tag => "v1.0.0" | |
option "without-completions", "Disable bash/zsh completions" | |
depends_on "go" => :build |
OlderNewer