View functionalWay.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// you can't modify shipped code | |
object VendorLib { | |
trait Json | |
case class JsonString(get: String) extends Json | |
case class JsonObject(get: Map[String, Json]) extends Json | |
case class JsonArray(get: List[Json]) extends Json |
View gist:aee4f4d0f9eba64110565bed6c73cfb5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import VendorLib.JsonString | |
// rules : | |
// 1) You can't change VendorLib | |
// 2) You can't change UserCode | |
// 3) Type safety | |
object VendorLib { | |
sealed trait Json | |
case class JsonString(s: String) extends Json | |
case class JsonArray(a: Seq[Json]) extends Json |
View fpis.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//> using lib "org.scalameta::munit:1.0.0-M6" | |
//@annotation.tailrec | |
def fib(n: Int): Int = | |
if (n == 0) 0 | |
else if (n == 1) 1 | |
else fib(n - 1) + fib(n - 2) | |
def fib2(n: Int): Int = | |
@annotation.tailrec |
View Function_syntax.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; no arguments | |
(fn [] (println "Hello")) | |
;; one argument | |
(fn [s] (println s)) | |
;; two arguments | |
(fn [x y] (+ x y)) | |
;; with type hint |
View ambiant.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_bpm 89 | |
def tl(name) | |
in_thread(name: name) do | |
loop do | |
send(name) | |
end | |
end | |
end |
View random_album.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is semi-automated (read quick & dirty, didn't polished) way to play a random album on Deezer | |
You need to navigate to the fav albums page, press F12 and past this gist in the console. | |
*/ | |
(async function() { | |
for(let i = 0; i< 500; i++) { | |
window.scrollTo(0, document.body.scrollHeight); | |
await new Promise(r => setTimeout(r, 2)); | |
} | |
var playBtn = document.querySelectorAll('button.action-item-btn[aria-label=\'Pause\']'); |
View dub.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_bpm 128 | |
tpb = 60 / 128.0 | |
chord_trigg = [0, 0,1,0] | |
kick_trigg = [1, 0,0,0] | |
snare_trigg = [1, 0 ,0,0] | |
bass_trigg = [0,1, 0 ,1] | |
ks = [:kick, :snare] | |
define :orchestrator do | |
cue ks.tick(:ks) if kick_trigg.tick(:kick) > 0 |
View Oblique strategies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
["A line has two sides", "Abandon desire", "Abandon normal instructions", "Accept advice", "Adding on", "Always the first steps", "Ask people to work against their better judgement", "Ask your body", "Be dirty", "Be extravagant", "Be less critical", "Breathe more deeply", "Bridges -build -burn", "Change ambiguities to specifics", "Change nothing and continue consistently", "Change specifics to ambiguities", "Consider transitions", "Courage!", "Cut a vital connection", "Decorate", "Destroy nothing; Destroy the most important thing", "Discard an axiom", "Disciplined self-indulgence", "Discover your formulas and abandon them", "Display your talent", "Distort time", "Do nothing for as long as possible", "Do something boring", "Do something sudden", "Do the last thing first", "Do the words need changing?", "Don't avoid what is easy", "Don't break the silence", "Don't stress one thing more than another", "Emphasize differences", "Emphasize the flaws", "Faced with a choice", "Find a safe part and use it as an anchor |
View french.adventuron
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###################################### | |
# Adventuron en français # | |
###################################### | |
start_at = plage | |
###################################### | |
# Locations # | |
###################################### |
View reggaeish.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use_bpm 128 | |
tpb = 60 / 128.0 | |
chord_trigg = [0, 0,1,0] | |
kick_trigg = [1, 0,0,0] | |
snare_trigg = [1, 0 ,0,0] | |
bass_trigg = [0,1, 0 ,1] | |
ks = [:kick, :snare] | |
define :orchestrator do |
NewerOlder