Skip to content

Instantly share code, notes, and snippets.

View stevendborrelli's full-sized avatar

Steven Borrelli stevendborrelli

  • Upbound.io
  • St. Louis, Missouri
View GitHub Profile
@stevendborrelli
stevendborrelli / gist:8101862
Created December 23, 2013 18:07
Compiling mesos on OSX 10.9.x
#Using homebrew
# gcc 4.9 build fails on template warnings
# clang not supported yet
brew tap homebrew/versions
brew install gcc47
{
"id": "elasticsearch",
"instances" : "1",
"mem": "1024",
"cpus": "1",
"executor": "/var/lib/mesos/executors/docker",
"cmd": "'relateiq/elasticsearch'",
"env": {
},
"ports": [ 9200, 9300 ]
@stevendborrelli
stevendborrelli / boot2docker.json
Last active December 31, 2015 02:08
Packer.io json template for boot2docker
{
"builders": [{
"type": "virtualbox",
"guest_os_type": "Linux",
"iso_url": "https://github.com/steeve/boot2docker/releases/download/v0.3.0/boot2docker.iso",
"iso_checksum": "e03670ed349c54848e20d9043a90f2df8df70d82e674b84a7083301193745b19",
"iso_checksum_type": "sha256",
"ssh_username": "docker",
"ssh_password": "tcuser",
"shutdown_command": "sudo poweroff"
@stevendborrelli
stevendborrelli / deviceInfo.cu
Created December 14, 2012 16:49
Get Information about CUDA cards on your system. Compile with: nvcc deviceInfo.cu -o deviceInfo
#include <cuda.h>
#include <stdio.h>
void cudasafe(int error, char* message, char* file, int line) {
if (error != cudaSuccess) {
fprintf(stderr, "CUDA Error: %s : %i. In %s line %d\n", message, error, file, line);
exit(-1);
}
}
val a = ('a', 2) //> a : (Char, Int) = (a,2)
val b = ('b', 2) //> b : (Char, Int) = (b,2)
val c = ('c', 3) //> c : (Char, Int) = (c,3)
val d = ('d', 1) //> d : (Char, Int) = (d,1)
val list = List(a, b, c, d) //> list : List[(Char, Int)] = List((a,2), (b,2), (c,3), (d,1))
val sub = List(('a', 1), ('b', 4), ('c', 3)) //> sub : List[(Char, Int)] = List((a,1), (b,4), (c,3))
def combo(sub: Occurrences): List[Occurrences] = {
val acc: List[Occurrences] = List(List())
sub match {