Skip to content

Instantly share code, notes, and snippets.

View itrion's full-sized avatar

Johan Sebastian Cortes Montenegro itrion

View GitHub Profile
#!/usr/bin/env zsh
# install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install homebrew cask and fonts
brew tap caskroom/cask
@itrion
itrion / echo_google_spreadsheet
Created July 12, 2017 14:41
calling google spreadsheet api using ruby client lib
#!/usr/bin/env ruby
SECRET_JSON_VARIABLE = 'GOOGLE_APPLICATION_CREDENTIALS'.freeze
raise 'please define an env variable GOOGLE_APPLICATION_CREDENTIALS pointing to your client_secrets.json' unless ENV[SECRET_JSON_VARIABLE]
raise 'please provide the spreadsheet id' if ARGV[0].nil?
require 'google/clients/spreadsheet_client'
require 'google/models/spreadsheet'
spreadsheet_id = ARGV[0]
spreadsheet = Google::Models::Spreadsheet.new(spreadsheet_id: spreadsheet_id)
@itrion
itrion / gist:0a3d72160f01bf804412383c423e1497
Created March 31, 2017 21:59
start and stop virtual machines with vboxmanage
VBoxManage startvm "Ubuntu Server" --type headless
VBoxManage controlvm "Ubuntu Server" poweroff
package com.rtr.godmother.api.models;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rtr.serializers.DateTimeJsonHelper;
import com.rtr.serializers.LocalDateJsonHelper;
import org.joda.time.DateTime;
import org.joda.time.LocalDate;
@itrion
itrion / build.gradle
Last active August 29, 2016 13:42
create a jar with dependencies included in gradle
jar {
manifest {
attributes 'Main-Class': 'org.itrion.MainClass'
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
@itrion
itrion / gist:734491db129667504b049b31ef8d58b7
Created June 16, 2016 09:35
Clean local repository of dependencies in maven
mvn dependency:purge-local-repository
@itrion
itrion / ruby version and gemset
Last active May 18, 2016 08:59
Create the .ruby-version and .ruby-gemset files using rvm
rvm --create --ruby-version x.y.z@gemsetname
@itrion
itrion / package.json
Created February 22, 2016 22:19
configure webpack to compile bootstrap
{
"devDependencies":
{
"babel-core": "^6.2.1",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"css-loader": "^0.23.1",
"file-loader": "^0.8.5",
"url-loader": "^0.5.7",
"less-loader": "^2.2.2",
@itrion
itrion / year log history
Created December 11, 2015 12:02
List all merges into master with the message of the commits
git log --since=01/01/2015 --merges --format="%ad%n%t%n%B" --abbrev-commit --reverse
fun main(args: Array<String>) {
println(helloTo("Johan"))
println(sumOf(1))
println(sumOf(1, 2))
println(sumOf(lhs = 1, rhs = 2))
println(sumOf(1, 2, 3, 4, 5))
val customer = Customer("Customer", "[email protected]")
// customer.name = "not allowed, name is val"
customer.email = "[email protected]"