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 ruby | |
# Our test cases will always use the same dictionary file (with SHA1 | |
# 6b898d7c48630be05b72b3ae07c5be6617f90d8e). Running `test/harness` | |
# will automatically download this dictionary for you if you don't | |
# have it already. | |
path = ARGV.length > 0 ? ARGV[0] : '/usr/share/dict/words' | |
entries = File.read(path).split("\n") |
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 | |
exec java \ | |
-server \ | |
-Djava.awt.headless=true \ | |
-Xms256M \ | |
-XX:CompileThreshold=1400 \ | |
-Xloggc:./memory.log -verbose:gc -XX:+PrintGCDetails \ | |
-cp out \ | |
jim.SpellCheck \ | |
$@ |
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 logging | |
def do_work(): | |
logging.debug("x") | |
if __name__ == '__main__': | |
# Register STDOUT as a log handler. | |
# There are other ways to register handlers, but this is the simplest way. | |
# See https://docs.python.org/2/library/logging.html#logging.basicConfig |
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 | |
# Usage: | |
# Without trace, just run `./do-stuff.sh` | |
# With trace, use `BASH_XTRACEFD=3 ./do-stuff 3> trace.txt` | |
# Requires bash 4.+ | |
set -o pipefail | |
set -o nounset | |
set -o errexit | |
if [[ ${BASH_XTRACEFD:+x} ]]; then |
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 | |
libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \ | |
"/usr/local/lib/libosxfuse_i32.2.dylib" \ | |
"/usr/local/lib/libosxfuse_i64.2.dylib" \ | |
"/usr/local/lib/libmacfuse_i64.2.dylib" \ | |
"/usr/local/lib/libosxfuse_i32.la" \ | |
"/usr/local/lib/libosxfuse_i64.la" \ | |
"/usr/local/lib/pkgconfig/osxfuse.pc" ) |
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" | |
func main() { | |
// make sure that printf pads digits with zeros so we can sort the strings | |
// without converting to them back to ints | |
fmt.Printf("%010d\n", 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
package main | |
// crash_recover.go experiments with recovering from a file that suddenly | |
// crashed (files are written without sync or close.) | |
import ( | |
"encoding/binary" | |
"fmt" | |
"math/rand" | |
"os" |
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 | |
// parallel_rw.go experiments with parallel read/write from a file without | |
// syncing (aka flushing) or closing. | |
import ( | |
"encoding/binary" | |
"fmt" | |
// "math/rand" | |
"os" |
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 flushing | |
import ( | |
"encoding/binary" | |
"fmt" | |
"math/rand" | |
"os" | |
"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
def x(): | |
# using a function as a convenient global object | |
print 'hello!' | |
x.favorite_band = 'Maroon 5' | |
def went_to_music_festival(s): | |
print 'favorite band was ' + x.favorite_band |
OlderNewer