Skip to content

Instantly share code, notes, and snippets.

View nbari's full-sized avatar
🪴

nbari

🪴
View GitHub Profile
@nbari
nbari / vm-resize-hard-disk.md
Created December 17, 2015 09:38 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@nbari
nbari / golang.sh
Created December 16, 2015 14:05 — forked from jacoelho/golang.sh
Install golang debian/ubuntu
#!/bin/bash
export GOLANG_VERSION=1.5.2
export GOLANG_DOWNLOAD_URL=https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
export GOLANG_DOWNLOAD_SHA1=cae87ed095e8d94a81871281d35da7829bd1234e
apt-get update -qq
apt-get install -y --no-install-recommends \
g++ \
@nbari
nbari / Makefile
Created November 16, 2015 12:41
Makefile npm, bower
.PHONY: all test build deps
all: deps
deps:
npm install
bower --force install
build:
grunt production && tar -jcf app.bz2 dist/
@nbari
nbari / scheduler.go
Created October 29, 2015 11:04
start/stop scheduler via http
package main
import (
"fmt"
"log"
"net/http"
"time"
)
var timer *time.Ticker
@nbari
nbari / panic.go
Last active September 14, 2015 10:05
recover from panic within Goroutines
// The 'recovery' part of a panic has to happen on the same goroutine as the
// panic itself, otherwise it bubbles to the top without being captured. so it
// needed to be "attached" to the same thing that called foo, which was your
// anonymous func the recovery itself is a deferred anonymous func and if it
// feels difficult to use, then that's excellent. you shouldn't be using this,
// and should avoid code that does 'neat' things in this direction
package main
import "fmt"
@nbari
nbari / dynamic.go
Last active August 27, 2015 12:41
dynamic map
package my_package
import (
"fmt"
"errors"
"regexp"
"strings"
)
type dynamicSet map[string]regexp.Regexp

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

@nbari
nbari / gist:9f4666ad51565a03e260
Last active August 29, 2015 14:20
insert sort + unique
//Create some data for testing using:
// jot -s, -r 10000000 1 256 > data
//Test using:
// cat data | ./sort
package main
import (
"bufio"
"fmt"
--- deps/erlang_js/c_src/patches/js-src-config-FreeBSD.mk.patch.orig 2015-02-26 16:11:58 UTC
+++ deps/erlang_js/c_src/patches/js-src-config-FreeBSD.mk.patch
@@ -1,6 +1,6 @@
--- c_src.orig/js/src/config/FreeBSD.mk 1969-12-31 19:00:00.000000000 -0500
+++ c_src/js/src/config/FreeBSD.mk 2011-03-30 20:12:51.000000000 -0400
-@@ -0,0 +1,99 @@
+@@ -0,0 +1,100 @@
+# -*- Mode: makefile -*-
+#
+# ***** BEGIN LICENSE BLOCK *****
@nbari
nbari / riak 2.0.5
Last active August 29, 2015 14:16
riak 2.0.5 FreeBSD
# $FreeBSD: head/databases/riak/Makefile 371981 2014-11-01 00:09:15Z bapt $
PORTNAME= riak
PORTVERSION= 2.0.5
CATEGORIES= databases
MASTER_SITES= http://s3.amazonaws.com/downloads.basho.com/riak/${PORTVERSION:R}/${PORTVERSION}/ \
http://downloads.basho.com.s3.amazonaws.com/riak/${PORTVERSION:R}/${PORTVERSION}/
MAINTAINER= [email protected]
COMMENT= Riak is an open source, distributed, noSQL database