Skip to content

Instantly share code, notes, and snippets.


Ben Schwartz benschw

View GitHub Profile
benbjohnson / gist:8338908
Created Jan 9, 2014
Cross Compile w/
View gist:8338908
# This is what I have so far. The Go 1.2 installation doesn't seem to be correct so it's still breaking.
rm -rf /usr/local/go/src/pkg/appengine
rm -rf /usr/local/go/src/pkg/appengine_internal
rm /usr/local/go/src/pkg/os/error_posix.go
wget -O
source golang-crosscompile-master/crosscompile.bash
go-crosscompile-build darwin/amd64
jmervine /
Last active Jul 31, 2016
Installing GoLang - Ubuntu 12.04.3 LTS \n \l
#!/usr/bin/env bash
# Example usage:
# $ VERSION=1.3 sudo ./
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
jclem /
Last active Dec 25, 2015
An attempt at explaining promises.


Before Promises

Say in a JavaScript application, we need to make a request to and then log the response. Let's walk through a few ways to do it.

Here's the worst way:

var result;
chriswhitcombe / Configurer
Created Sep 10, 2013
Sample code to load archaius properties statically via spring
View Configurer
public class ArchaiusPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer {
protected String resolvePlaceholder(String placeholder, Properties props, int systemPropertiesMode) {
return DynamicPropertyFactory.getInstance().getStringProperty(placeholder, "null").get();
mumrah /
Created Sep 4, 2013
Example of configuring Archaius through Spring XML. Package names have been removed, so this probably won't work without some modification.
import org.apache.commons.configuration.AbstractConfiguration;
import java.util.ArrayList;
import java.util.List;
public class ConcurrentCompositeConfigurationFactory {
List<AbstractConfiguration> configs = new ArrayList<AbstractConfiguration>();
public void setConfigs(List<AbstractConfiguration> configs) {
sandys /
Created Oct 13, 2012
Mount the HTC One X on Linux (Ubuntu 12.04 Precise)
sudo apt-get install golang git mercurial
git clone
cd go-mtpfs
go build
sudo mv go-mtpfs /usr/local/sbin/go-mtpfs 
sudo chmod a+x /usr/local/sbin/go-mtpfs
sudo mkdir /media/mtp
sudo chmod 775 /media/mtp
sudo /usr/local/sbin/go-mtpfs -allow-other=true /media/mtp
joemiller / sensu-handler-input-example.json
Created Feb 2, 2012
example json data passed into Sensu handlers via STDIN
View sensu-handler-input-example.json