Skip to content

Instantly share code, notes, and snippets.

View cristobal's full-sized avatar
💭
¯\_(ツ)_/¯

Cristobal Dabed cristobal

💭
¯\_(ツ)_/¯
View GitHub Profile
@cristobal
cristobal / set-jboss-home.sh
Last active August 29, 2015 14:02
Bash - set JBoss Home Runtime from Brew install name or /Path/to/JBoss/installation
#!/usr/bin/env bash
##########################
# Export new jboss path #
#########################
function export_path {
# already same as exported variables(s) no changes needed
if [ ! -z "$JBOSS_HOME" ] && \
[ "$JBOSS_HOME" = "$jboss_dir" ] && \
@cristobal
cristobal / jekyll_sync_publich.sh
Created May 14, 2014 12:17
Jekyll Sync Publish Cronjob
#!/usr/bin/env bash
# 0. cd into dir
dir=$(dirname $0)
cd $dir
# 1. Sync from master
git pull origin master
# 2. Get SHA's
@cristobal
cristobal / ruby193-installer.sh
Last active August 29, 2015 14:01 — forked from futuremill-ltd/gist:2318876
Building Ruby 1.9.3 p545 package for Debian Squeeze
#!/usr/bin/env bash
# From a fresh install of squeeze
apt-get install ruby rubygems # Need ruby to use fpm
gem1.8 install fpm --no-ri --no-rdoc
apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p545.tar.gz
tar -zxvf ruby-1.9.3-p545.tar.gz
cd ruby-1.9.3-p545
import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Properties;
@cristobal
cristobal / FibonacciModule.java
Created April 1, 2014 12:29
Fibonacci Module, resolving Fib in Java.
import java.lang.reflect.InvocationTargetException;
import java.util.WeakHashMap;
import java.util.concurrent.TimeUnit;
// @see http://java67.blogspot.sg/2012/07/java-program-fibonacci-series-with.html
// @see https://github.com/raganwald/homoiconic/blob/master/2008-12-12/fibonacci.md
public class FibonacciModule {
@cristobal
cristobal / osx-openfl-install.sh
Created April 1, 2014 07:34
OSX Openfl Install
# Install Haxe using Brew and set the haxelib path
brew install haxe
haxelib setup /usr/local/Cellar/haxe/lib
# Install lime
haxelib install lime
haxelib run lime setup
# Install lime tools
haxelib install format
@cristobal
cristobal / codeinlang.py
Created March 31, 2014 08:48
Do you want to script in some random lang, just change the langs list to your choice…
#!/usr/bin/env python
import sys
from random import shuffle
def main():
langs = ["coffe", "node", "lua", "python", "ruby", "php"]
scores = {}
for lang in langs:
scores[lang] = 0
public class JavaTutorial10 {
public static void main(String[] args) {
String value = "abc";
// 1. Strings are not null terminated in java
System.out.println(value.toCharArray());
System.out.println("");
@cristobal
cristobal / shuffle.lua
Created March 25, 2014 22:00
Lua implementation of Fisher-Yates Shuffle "inside-out"
-- Remember to seed outside the function i.e. at top of your script
-- especially on OSX otherwise you will get the same permutations.
-- math.randomseed(os.time())
-- More info http://lua-users.org/wiki/MathLibraryTutorial
function random(min, max)
if (max == null) then
max = min
min = 0
end
@cristobal
cristobal / Intellij.desktop
Created October 14, 2013 12:50
Intellij Desktop Entry for Ubuntu
[Desktop Entry]
Name=IntelliJ
Comment=The Best Java and Polyglot IDE
Exec=/home/cristobal/Applications/idea-<version>/bin/idea.sh
Icon=/home/cristobal/Applications/idea-<version>/bin/idea.png
Terminal=false
StartupNotify=true
Type=Application
Categories=Development;IDE;