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)

Keybase proof

I hereby claim:

  • I am Jell on github.
  • I am jell (https://keybase.io/jell) on keybase.
  • I have a public key whose fingerprint is 4FC1 6BA1 7B0D CB89 9AA9 CDEE 6F59 07B1 521F CF64

To claim this, I am signing this object:

@Jell
Jell / immutable_record.rb
Last active August 29, 2015 14:07
Immutable Record
## DEFINITION ##
# Compact version, with just a hint of meta-programming
Item = ImmutableRecord.new(:foo, :bar)
# Strict Equivalent, without meta-programming:
class ItemBis < ImmutableRecord::Value
def self.attributes
[:foo, :bar]
end
@Jell
Jell / fizzbuzz_constants.rb
Last active August 29, 2015 14:07
FizzBuzz qualified constants
require 'active_support/core_ext'
module T
module T
module T
def self.zero; end
end
end
end

Definitely:

  • craft conf, Budapest (April 22-24) Many clojure and ICFP people
  • code mesh, London (November 2-4)

Maybe:

  • polyconf, POZnan (Poland) (July 2-4)
@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
@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 / 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}}
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/
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