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
function gitclb --description 'Remove local branches that are not in origin' | |
git fetch -p | |
set default N | |
set options "y/N" | |
for option in $argv | |
switch "$option" | |
case "-Y" "--yes" | |
set default Y |
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 "testing" | |
func BenchmarkPrependAppend(b *testing.B) { | |
s := []string{"one", "two", "three", "four"} | |
word := "zero" | |
for i := 0; i < b.N; i++ { | |
s = append([]string{word}, s...) | |
} |
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" | |
"math/rand" | |
"time" | |
) | |
type Barber struct { | |
Customer chan *Customer |
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
<html> | |
<head> | |
<title> Koch Snowflake, maybe?</title> | |
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.4/themes/dark-hive/jquery-ui.css"> | |
<script src="https://code.jquery.com/jquery-1.10.2.js"></script> | |
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script> | |
<script> | |
KochSnowflake = function(elem) { | |
this.canvas = elem; | |
this.context = this.canvas.get(0).getContext("2d"); |