Skip to content

Instantly share code, notes, and snippets.

View rjnienaber's full-sized avatar

Richard Nienaber rjnienaber

View GitHub Profile
$ toolset/run-tests.py --install server --test go
FWROOT is /home/vagrant/FrameworkBenchmarks
WARNING:root:results.json for test ec2 not found.
INSTALL: Installing server software (strategy=unified)
INSTALL: . $FWROOT/toolset/setup/linux/bash_functions.sh && . $FWROOT/toolset/setup/linux/prerequisites.sh (cwd=$FWROOTinstalls)
Prerequisites installed!
INFO:root:Running installation for directory /home/vagrant/FrameworkBenchmarks/frameworks/Go/go (cwd=/home/vagrant/FrameworkBenchmarks/frameworks/Go/go)
INFO:root:Loading environment from /home/vagrant/FrameworkBenchmarks/frameworks/Go/go/bash_profile.sh (cwd=/home/vagrant/FrameworkBenchmarks/frameworks/Go/go)
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 8080 => 28080 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
@rjnienaber
rjnienaber / gist:bf43a677e374504799ab
Created December 18, 2014 08:40
Example protocol buffer
require 'protocol_buffers'
class User < ProtocolBuffers::Message
required :string, :name, 1
required :string, :email, 2
optional :int32, :logins, 3
end
class Group < ProtocolBuffers::Message
repeated User, :users, 1
@rjnienaber
rjnienaber / gist:3c9c0973891e8cbd6312
Created February 23, 2015 08:30
Quorum3 Compiler output
quorum-language$ cd Quorum3/SourceCode/
SourceCode$ java -jar ../../QuorumTomcat/dependencies/Quorum.jar -name Quorum -compile main.quorum TypeCheckTesterGenerated.quorum GenericResolution.quorum TemplatingTesterGenerated.quorum ChainingTester.quorum AccessModifierContext.quorum ErrorBlockLabels.quorum ObjectAssignmentContext.quorum Action.quorum ExceptionTester.quorum ObjectToPrimitiveBooleanCast.quorum ActionCall.quorum ExplicitCastOpcode.quorum ObjectToPrimitiveIntegerCast.quorum ActionCallContext.quorum ExpressionsTester.quorum ObjectToPrimitiveNumberCast.quorum ActionCallOpcode.quorum FlipBooleanOpcode.quorum ObjectToPrimitiveTextCast.quorum ActionCallResolution.quorum FormalParameterContext.quorum Operation.quorum ActionContext.quorum FullClassDeclarationContext.quorum OutputContext.quorum ActionExpressionListContext.quorum GenericContext.quorum OutputOpcode.quorum ActionOpcode.quorum GenericDeclarationContext.quorum PackageContext.quorum ActionsNoClassContext.quorum HashListIterator.quorum ParentAssign
@rjnienaber
rjnienaber / output
Created February 23, 2015 23:23
Failed Quorum Build
$ ant
Buildfile: /Users/richardn/projects/quorum-language/plugins/ParserPlugin/build.xml
-pre-init:
-init-private:
-init-user:
-init-project:
@rjnienaber
rjnienaber / Gemfile
Last active August 29, 2015 14:19
Enable http logging for http_client (JRuby)
# A sample Gemfile
source "https://rubygems.org"
gem "jruby-httpclient", require: 'http_client'
@rjnienaber
rjnienaber / command line
Last active August 29, 2015 14:19
Enable http logging for http_client without code changes (JRuby)
jruby -J-Djava.util.logging.config.file=logging.properties test.rb 2>&1 | grep FINE
var request = require('request');
var fs = require('fs');
var url = process.argv[2]; // url of the site
var certFile = process.argv[3]; // certificate from server
var ca = fs.readFileSync(certFile, 'ascii');
var options = {
url: url,
// rejectUnauthorized: false,
@rjnienaber
rjnienaber / Dockerfile
Created October 2, 2017 17:48
PHP 5.5 on Alpine Linux
# base for this file taken from here: https://github.com/GitHub30/php/blob/5.5/5.5/alpine/Dockerfile
FROM alpine:3.6
ENV BASE_LINUX alpine
RUN apk add --no-cache --virtual .persistent-deps \
ca-certificates \
curl \
tar \
xz \
apache2 \
@rjnienaber
rjnienaber / py3_flatten.py
Created November 14, 2017 00:29
Simple example of flattening an array in python3
def _flatten(values):
"""Recursively flattens a list using yield from"""
for v in values:
if (isinstance(v, list)):
yield from _flatten(v) # https://www.python.org/dev/peps/pep-0380/
else:
yield v
def flattened_list(values):
"""Recursively flattens a list. If the passed in argument is not a list, an