This file contains hidden or 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 gevent import spawn | |
from gevent.queue import Queue | |
def whisper(left, right): | |
left.put(right.get() + 1) | |
def main(): | |
n = 100000 | |
leftmost = Queue() | |
left, right = None, leftmost |
This file contains hidden or 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
""" | |
Re-bucket input histogram in linear or exponential buckets. | |
Input: | |
value\tcount | |
Output: | |
quantized_value\tcount | |
""" |
This file contains hidden or 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 | |
# find all branches which have been squash merged into master | |
require 'pp' | |
# all branches | |
branches = %x{git branch | sed s/^..//}.split.map(&:chomp) | |
# sort by branch age; generate pretty time stamp while we're at it | |
branch_times = branches.map{|branch| |
This file contains hidden or 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
# This is a shell archive. Save it in a file, remove anything before | |
# this line, and then unpack it by entering "sh file". Note, it may | |
# create directories; files and directories will be owned by you and | |
# have default permissions. | |
# | |
# This archive contains: | |
# | |
# Library/LaunchAgents/com.docker.machine.default.plist | |
# | |
echo x - Library/LaunchAgents/com.docker.machine.default.plist |
This file contains hidden or 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 | |
set -euo pipefail | |
IFS=$'\n\t' | |
scriptdir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) | |
. $scriptdir/env.sh | |
echo ">>>>> Mac Docker found - making /var/lib/kubelet shared" | |
MOBY_TTY="${HOME}/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty" | |
if [ -c "$MOBY_TTY" ]; then |
This file contains hidden or 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
[ | |
["f", "Show next/latest diffs", "setProposedRevRanges()"], | |
["shift+]", "Next unreviewed file", "nextUnreviewedFile()"], | |
["shift+[", "Previous unreviewed file", "prevUnreviewedFile()"], | |
["]", "Next changed file", "nextChangedFile()"], | |
["[", "Previous changed file", "prevChangedFile()"], | |
[null, "Next visible file", "nextVisibleFile()"], | |
[null, "Previous visible file", "prevVisibleFile()"], |
This file contains hidden or 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
-Xms4g | |
-Xmx4g | |
-XX:-UseParNewGC | |
-XX:-UseConcMarkSweepGC | |
-XX:ReservedCodeCacheSize=1g | |
-XX:+UseG1GC | |
-XX:+DisableExplicitGC |
This file contains hidden or 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
M140 S0 ; turn off bed | |
G91 ; relative mode | |
G1 Z20 ; lift | |
G90 ; absolute mode | |
G92 E18 ; extruder relative pos | |
G1 F300 ; set speed | |
G1 E0 ; retract filament | |
G92 E0 ; extruder relative pos |
This file contains hidden or 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 java.util | |
import java.util.concurrent.RejectedExecutionException | |
import com.twitter.app.App | |
import com.twitter.concurrent.Permit | |
import com.twitter.finagle.http.{Request, Response} | |
import com.twitter.finagle.util.HashedWheelTimer | |
import com.twitter.finagle.{Http, Service, param => fparam, _} |
This file contains hidden or 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 com.twitter.bijection.Bijection | |
package object tagging { | |
sealed trait Tagged[+V, +T] | |
type @@[+V, +T] = V with Tagged[V, T] | |
object Tagged { | |
implicit class Untaggable[V, T](val tagged: V @@ T) extends AnyVal { | |
@inline def untag: V = tagged | |
} |