Skip to content

Instantly share code, notes, and snippets.

Vagrant.configure("2") do |config|
config.vm.box = "ubuntu-12.04"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
# Install Chef version 11
config.vm.provision :shell, :inline => <<EOS
set -e
if ! command -V chef-solo >/dev/null 2>/dev/null; then
curl -L https://www.opscode.com/chef/install.sh | bash -s -- -v 11.6.0
fi
@advincze
advincze / new_gist_file
Created June 13, 2013 12:22
mvn quickstart archetype
mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart
@advincze
advincze / new_gist_file
Created June 12, 2013 18:45
simple gradle
apply plugin: 'java'
apply plugin: 'idea'
repositories {
mavenCentral()
}
dependencies {
compile 'org.jsoup:jsoup:1.7.2'
testCompile group: 'junit', name: 'junit', version: '4.+'
@advincze
advincze / gist:5664807
Last active December 17, 2015 19:59
angularjs share data state between service and controller
var myApp = angular.module('myApp', []);
myApp.factory('srv', function ($rootScope) {
srv = {
arr: []
};
var val = 1
setInterval(function () {
$rootScope.$apply(function () {
@advincze
advincze / helloworld.go
Created May 7, 2013 07:21
golang hello world
package main
import (
"fmt"
)
func main(){
fmt.Println("Hello world!")
}
,_---~~~~~----._
_,,_,*^____ _____``*g*\"*,
/ __/ /' ^. / \ ^@q f
[ @f | @)) | | @)) l 0 _/
\`/ \~____ / __ \_____/ \
| _l__l_ I
} [______] I
] | | | |
] ~ ~ |
| |
@advincze
advincze / workdisp.go
Created November 26, 2014 07:01
work dispatcher
package main
import (
"fmt"
"sync"
"time"
)
func worker(id int, jobs <-chan int, results chan<- int) {
for j := range jobs {