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
#!/usr/bin/env ruby | |
# Just call this without arguments. It will show a friendly help text. | |
# For xterm-256color, it will even use colors for some commands! | |
class AppConfig | |
@@default_remote = 'vpn.example.com' | |
@@default_networks = '10.0.0.0/24>192.168.1.0/24' | |
@@default_subject = '/C=US/ST=CA/L=San Francisco/O=Example/OU=/CN={{name}}' |
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
SELECT | |
NULL, # \N | |
false, # 0 | |
true, # 1 | |
0 = false, # 1 | |
1 = true, # 1 | |
2 = true, # 0 | |
true - false = 0, # 0 | |
true + false = 1, # 1 | |
true = null, # \N |
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 ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/hmac" | |
"crypto/rsa" | |
"crypto/sha1" | |
"crypto/x509" |
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 | |
### build nginx/openresty as a static binary with most recent libraries. | |
### apart from build tools, this script depends on sha256sum, tar, curl. | |
# features | |
ENABLE_MAIL="${ENABLE_EMAIL:-true}" | |
ENABLE_MEDIA="${ENABLE_MEDIA:-true}" | |
ENABLE_WEBDAV="${ENABLE_WEBDAV:-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
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
#!/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
#!/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
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package | |
// | |
// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. | |
// | |
// This Source Code Form is subject to the terms of the Mozilla Public | |
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | |
// You can obtain one at http://mozilla.org/MPL/2.0/. | |
package mysql |
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 { |
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) | |
} |
NewerOlder