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 bash | |
# TCR: test && commit || revert | |
# codified by Kent Beck | |
# https://medium.com/@kentbeck_7670/test-commit-revert-870bbd756864 | |
function test() { | |
echo | |
cd `git rev-parse --show-toplevel` | |
go test ./... |
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
class Path(object): | |
""" | |
This nifty class uses dynamic attribute resolution to mimic a directory | |
tree on a file system (either real or contrived). | |
""" | |
def __init__(self, root, enforce_real_paths=False): | |
self.root___ = str(root) | |
self.navigation___ = [] | |
self.enforce___ = enforce_real_paths | |
if self.enforce___ and not os.path.exists(self.root___): |
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
Show hidden characters
{ | |
"close_windows_when_empty": true, | |
"color_scheme": "Packages/Dayle Rees Color Schemes/sublime/darkside.tmTheme", | |
"draw_white_space": "all", | |
"font_face": "Source Code Pro", | |
"font_size": 19, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], |
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
[ | |
{ "keys": ["super+k", "super+w"], "command": "toggle_setting", "args": {"setting": "word_wrap"}}, | |
{ "keys": ["super+k", "super+m"], "command": "toggle_minimap" }, | |
{ "keys": ["super+k", "super+t"], "command": "delete_trailing_spaces" } | |
] |
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
Tweaks to Intellij: | |
Load Golang SDK | |
Mark Golang SDK as default | |
--- | |
Keyboard Shortcuts: | |
Go to end of file |
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 web | |
import ( | |
"bytes" | |
"reflect" | |
"regexp" | |
"fmt" | |
"errors" | |
"strings" | |
) |
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 ( | |
"fmt" | |
"log" | |
"net/http" | |
"net/http/httputil" | |
) | |
func main() { |
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 something | |
import "testing" | |
type MyFixture struct { | |
*testing.T | |
sut Something // stuff under test | |
} |
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
// traverse recursively finds a value in a JSON object that can contain fields and values, | |
// as long as all values are only JSON objects with similarly defined objects with fields and values. | |
// This works with structures like the US and International Street APIs. | |
// example: traverse(d, "components", "primary_number) // will return the primary number of the candidate) | |
func traverse(i interface{}, keys ...string) interface{} { | |
var ( | |
found bool | |
object map[string]interface{} | |
) | |
object, found = i.(map[string]interface{}) |
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 ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"strconv" | |
) | |
func main() { |