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
// this is a simple log action | |
function QueueActionLog(message) { | |
this.message = message || 'QueueActionLog :: got a action for job id(%s)'; | |
this.apply = function(job) { | |
console.log(util.format(this.message, job.id)); | |
return true; | |
}; | |
} |
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 | |
echo "If you're reading this I hope you are in a vm or I probably just saved your ass!" | |
exit | |
## Warning: | |
# | |
# This script could break the crap out of your machine, it's only for illustration. That | |
# said- how you manage your data is your business, but if your unsure of best practices I'll | |
# share the one rule I have that is unwavering: |
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 internal implements testing instrumentation for the wait package and | |
// serves as a staging area for experimental Waiter implementations. | |
package internal | |
import ( | |
"fmt" | |
"log" | |
"path/filepath" | |
"runtime" | |
"strings" |
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 server | |
import ( | |
"fmt" | |
"testing" | |
"time" | |
log "github.com/Sirupsen/logrus" | |
"github.com/osrg/gobgp/config" | |
"github.com/osrg/gobgp/packet/bgp" |
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
// https://github.com/osrg/gobgp/pull/1334 | |
package t0 | |
import ( | |
"bytes" | |
"fmt" | |
"net" | |
"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
package conv | |
// Example of fastest possible atoi in Go aside from ASM, the unsightly | |
// parenthesis and grouping is because I wrote this before the bounds check | |
// elimination improvements so having them all on one was much faster I'm not | |
// sure if this is still necessary, at least in the switch statement version I | |
// think the length check should be enough. | |
// | |
// FastInt64-24 5000000 293 ns/op | |
// Switch64-24 5000000 218 ns/op |
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 ( | |
"net/http" | |
"net/http/httptest" | |
"testing" | |
"github.com/julienschmidt/httprouter" | |
) |
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
//go:generate -command handy -o ./main.handy.go ./main.go | |
package main | |
import ( | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"time" |
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 ( | |
"context" | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
func NaiveRetry(attempts int, sleep time.Duration, fn func() error) error { |
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 | |
/* | |
package unibox | |
import ( | |
"bytes" | |
"strings" | |
"unicode/utf8" | |
) |
OlderNewer