Skip to content

Instantly share code, notes, and snippets.

@danielpetisme
danielpetisme / gist:5459559
Created April 25, 2013 13:07
Just to know what sound's cleaner or at leats more clear
@k33g_org way
function person = -> DynamicObject():
name("Golo"):
define("sayHello", |this| -> println(this: name()))
@danielpetisme way
function person = -> DynamicObject():
name("Golo"):
@danielpetisme
danielpetisme / Singoloton.golo
Created April 28, 2013 10:44
Design patterns are commons concepts for every devlopper. So I'm trying to implement the basic ones in Golo. The very first one is the Singoloton but I'm facing some issues. 1 - Is it possible to implement it in pure Golo? 2- Without DynamicObjects ? This is my shot. Any thoughts are welcomed!
module g0l0.patterns.creationnal.Singleton
local function _instance = -> null
local function _init = -> DynamicObject():
testing(|this| -> println(this + "doing some stuff"))
function MyObject = {
if _instance() is null {
module JGolo
import java.io.File
import java.nio.file.Files
import java.nio.file.LinkOption
import java.nio.file.StandardOpenOption
import java.nio.file.FileSystems
import java.util.ArrayList
import java.util.HashMap
import fr.insalyon.citi.golo.compiler.GoloClassLoader
@danielpetisme
danielpetisme / varargs.golo
Created August 27, 2013 08:49
Discover arguments size at runtime
module varargs
local function tests = {
let map = java.util.HashMap()
map: put("test0", { println("empty")})
map: put("test1", |a| -> println(a))
map: put("test2", |a, b| -> println(a + " " + b))
map: put("test3", |a, b, c| -> println(a + " " + b + " " + c))
return map
@danielpetisme
danielpetisme / RDO OpenStack installation
Last active December 22, 2015 04:29
RDO OpenStack installation
#Install rdo yum repository
sudo yum install -y http://rdo.fedorapeople.org/openstack/openstack-grizzly/rdo-release-grizzly.rpm
#Install the installation manager
sudo yum install -y openstack-packstack
#Run OpenStack installation
packstack --allinone --os-quantum-install=n
@danielpetisme
danielpetisme / Rakefile
Created September 18, 2013 16:47
Veewee + OpenStack Rakefile
task :default => [:all]
task :all, [:provider] => [:build, :halt, :shrink]
def isVeeweeFolder()
return if not Dir.exists? './definitions/'
end
def getBoxName()
return File.basename(Dir.glob("./definitions/*").at(0))
@danielpetisme
danielpetisme / veewee_installer.sh
Created September 18, 2013 16:54
Veewee installer
#Required packages
yum -y install gcc libxml2 libxml2-devel libxslt libxslt-devel libvirt libvirt-devel
#RVM - Ruby Version Manager
\curl -L https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
#Install 1.9.3
rvm install 1.9.3
#Config for rubygems
@danielpetisme
danielpetisme / gist:6867426
Created October 7, 2013 12:51
Logstash jenkins audit
{
"_index": "jenkins",
"_type": "logs",
"_id": "ogp1oxrmTC2KgDsdj7qQsg",
"_score": 2.3156765,
"_source": {
"message": "Oct 7, 2013 2:45:48 PM job/<JOB_NAME>/ #6690 Started by timer",
"@timestamp": "2013-10-07T12:45:49.390Z",
"@version": "1",
"type": "jenkins",
@danielpetisme
danielpetisme / golo.plugin.zsh
Created December 10, 2013 21:26
Golo ZSH integration It relies on the existing golo-bash-completion (it actyually sources it) Source of the idea: http://stackoverflow.com/a/8492043
###################################################################################
# Copyright 2012-2013 Institut National des Sciences Appliquées de Lyon (INSA-Lyon)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@danielpetisme
danielpetisme / gist:8558551
Last active January 4, 2016 02:59
Golosa Test elevator pitch

Golosa Test

The world didn’t need another tesing framework. So we built yet another one. A Golo one: Golosa Test

Golosa Test is a behavior-driven development framework for testing mainly inspired by Jasmine (a JS behavioral testing framework). Since a snippet is worth a thousand words:

module my.awesome.test

#The only import gather all the Golosa SA API
import golosa.test.$