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
<!DOCTYPE html> | |
<html><head><title>Go: '*reflect.StructField'</title><style> | |
html { background-color: #fafafa; } | |
div[data-kind] { | |
box-sizing: border-box; | |
position: relative; | |
/* font */ | |
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; | |
font-weight: 300; |
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 | |
# crash on error exit codes and undefined variables | |
set -e -u | |
if [ "true" = "$TRACE" ]; then | |
# trace execution (+x to get rid of noise) | |
set -x | |
fi |
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 style="padding: 0; margin: 0; width: 690; height: 480;"><head> | |
<hta:application id="oShortcutter" applicationname="Shortcutter" border="thin" caption="yes" contextmenu="no" scroll="no" showintaskbar="yes" singleinstance="yes" /> | |
<title>Shortcut Generator</title> | |
<script language="VBScript"> | |
'<![CDATA[ | |
Option Explicit | |
On Error Resume Next | |
Sub SelectFolder | |
' For next value see http://msdn.microsoft.com/en-us/library/bb773205(VS.85).aspx |
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 | |
# stop on errors and undeclared variables | |
set -e -u -o pipefail | |
err() { | |
echo "[$(date +'%Y-%m-%dT%H:%M:%S%z')]: $@" >&2 | |
} |
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 set | |
type Set interface { | |
Empty() bool | |
Size() int | |
Equal(t Set) bool | |
Subset(t Set) bool | |
Superset(t Set) bool | |
Union(t Set) Set | |
Intersection(t Set) Set |
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 "reflect" | |
// assumption for fptr: func with error as last argument | |
func makeMust(fptr interface{}) { | |
must := func(in []reflect.Value) []reflect.Value { | |
if err := in[len(in)-1]; !err.IsNil() { | |
panic(err.Interface()) | |
} | |
return in[:len(in)-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
#!/bin/bash | |
# exit on error, undeclared variables and pipe failures | |
set -e -u -o pipefail | |
# ansible is made for python 2.7+ | |
# TODO: check version(s) and provide better errors if anything fails | |
# install virtualenv if it's not installed yet | |
which -s virtualenv || (sudo easy_install pip && sudo pip install virtualenv) |
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 ( | |
"compress/gzip" | |
"fmt" | |
"io" | |
"os" | |
"strconv" | |
"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
type closer interface { | |
Close() error | |
} | |
type errorMessage string | |
func (err errorMessage) Error() string { | |
return string(err) | |
} |
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 java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import java.util.Arrays; | |
import static org.junit.Assert.assertEquals; | |
import static org.junit.Assert.fail; | |
public final class TestHelper { | |
public static void test(Object[][] tests, Object target, String methodName, Class<?>...argsTypes) throws Exception { |