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
// RunParallel is a drop-in replacement for testify/suite.Run that runs | |
// all tests in parallel. | |
// | |
// It uses reflection to create a new instance of the suite for each | |
// test | |
func RunParallel(t *testing.T, userSuite suite.TestingSuite) { | |
if _, ok := userSuite.(suite.SetupAllSuite); ok { | |
t.Log("Warning: SetupSuite exists but not being run in parallel mode.") | |
} | |
if _, ok := userSuite.(suite.TearDownAllSuite); ok { |
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
#!/bin/bash | |
# | |
# Spawn a process and restart it if it exits. | |
# | |
declare -i exit_code | |
declare -i pid | |
_cleanup() { | |
echo "[$(date)]: sending TERM to pid $pid" | |
kill -TERM $pid |
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
# | |
# Change to the directory of the specified Go package name. | |
# | |
gg() { | |
paths=($(g "$@")) | |
path_index=0 | |
if [ ${#paths[@]} -gt 1 ]; then | |
c=1 |
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
#!/bin/bash | |
# | |
# Same as `go get` but you can specify a git commit ref. | |
# | |
set -e | |
# | |
# Resolve the path to the Go workspace from GOPATH. | |
# | |
_go_workspace() { |
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 foo | |
type FooInterface interface { | |
FooFunc() | |
} |
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
Copyright (c) 2016 Daniel Simmons | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in |
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 foo | |
type Interface interface { | |
foo() | |
} |
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
from Foundation import CFPreferencesSetValue | |
from Foundation import CFNotificationCenterPostNotification | |
from Foundation import CFNotificationCenterGetDistributedCenter | |
from Foundation import kCFPreferencesAnyApplication | |
from Foundation import kCFPreferencesCurrentUser | |
from Foundation import kCFPreferencesCurrentHost | |
# Remove offending preference | |
CFPreferencesSetValue('AppleInterfaceStyle', None, kCFPreferencesAnyApplication, | |
kCFPreferencesCurrentUser, kCFPreferencesCurrentHost) |
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/python | |
import sys | |
import time | |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler | |
class RequestHandler(BaseHTTPRequestHandler): | |
def do_GET(s): | |
while True: | |
time.sleep(1000) |
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
<script src="https://raw.github.com/hassankhan/emojify.js/master/emojify.min.js"></script> | |
<script> | |
(function() { | |
// Config | |
emojify.setConfig({ | |
img_dir : '/emoji', | |
ignored_tags : { | |
'SCRIPT' : 1, | |
'TEXTAREA': 1, | |
'A' : 1, |