Skip to content

Instantly share code, notes, and snippets.

View Jell's full-sized avatar

Jean-Louis Giordano Jell

View GitHub Profile
@Jell
Jell / applicative.clj
Last active August 29, 2015 14:04
Trying to add type annotations to Applicative
(t/defprotocol Applicative
(pure* [f-val val])
(fapply* [f-fun f-vals]))
(t/ann-protocol [domain]
Applicative
pure* [(Applicative domain) domain -> (Applicative domain)]
fapply* (t/All [x ...]
[(Applicative [x ... x -> domain])
(Applicative x) ... (Applicative x)
@Jell
Jell / thor_autocomplete.rb
Last active April 12, 2020 23:39
Thor autocomplete
#!/usr/bin/env ruby
# Complete thor tasks script for bash
# Save it somewhere and then add
# complete -C path/to/script -o default thor
# to your ~/.bashrc
require 'fileutils'
THORFILES = ['thorfile', 'Thorfile', 'thorfile.rb', 'Thorfile.rb', '*.thor']
# Install java and make sure JAVA_HOME is properly set.
# Make sure those dependencies are present:
sudo apt-get install g++ uuid-dev libtool autoconf automake
cd ~
# install zeromq
wget http://download.zeromq.org/zeromq-2.1.7.tar.gz
tar -xzf zeromq-2.1.7.tar.gz
@Jell
Jell / storm.yaml
Last active December 16, 2015 11:39
---
nimbus.host: "192.168.1.106"
storm.zookeeper.servers:
- "192.168.1.106"
storm.local.dir: "/mnt/storm"
worker.childopts: "-Xmx128m"
supervisor.childopts: "-Xmx128m"
supervisor.slots.ports:
- 6700
at_exit do
ActiveRecord::Base.clear_all_connections!
java.lang.Thread.all_stack_traces.key_set.each do |t|
t.synchronized do
if t.name.include?("Abandoned connection cleanup thread")
t.class.shutdown
end
end
end
end
TorqueBox = "Ruby" + "JBoss"
{"TL;DR" => "TorqueBox ROCKS! But..."}
JBoss = "JVM Application Server"
WHY = "WE NEED MOAR STUFF!" and we != "SysAdmins"
pros = [
:clustering,
:background_jobs, # \o/
@Jell
Jell / es.clj
Last active December 15, 2015 20:41 — forked from fredyr/es.clj
(def game-results {:rock {:rock :tie, :paper :lose, :scissor :win}
:paper {:rock :win, :paper :tie, :scissor :lose}
:scissor {:rock :lose, :paper :win, :scissor :tie}})
(defn create-game-command
[{:keys [aggregate-id player move]} state]
[{:event :game-created
:game-id aggregate-id
:creator player
:state-change {:state :started :creator player}}
@Jell
Jell / watchr.rb
Created June 22, 2012 11:28
Watchr config for Matlab "autotest"
watch( '^(test.*)\.m$' ) { |md|
system("matlab -nodisplay -nodesktop -nojvm -r '#{md[1]}; quit'")
}
watch( '^(?!test)(.*)\.m$' ) { |md|
system("matlab -nodisplay -nodesktop -nojvm -r 'test#{md[1]}; quit'")
}
@Jell
Jell / versions.txt
Created May 4, 2012 09:33
Versions
RVM 1.13.0
Ruby 1.9.3-p194
Rails 3.2.3
Bundler 1.1.3
Rake 0.9.2.2
Gem 1.8.24
Ubuntu 12.04