Skip to content

Instantly share code, notes, and snippets.

@yawnt
yawnt / monad_error.scala
Created August 10, 2017 17:55 — forked from etorreborre/monad_error.scala
Why is MonadError helpful?
/**
* Let's say I can read things from a "Store"
*/
trait Store[F] {
def read(path: Path): F[String]
}
/**
* Now I want to read more specific things, like a Configuration
*
import static java.lang.System.out;
public class InterThreadLatency
{
private static final int REPETITIONS = 100 * 1000 * 1000;
private static volatile int ping = -1;
private static volatile int pong = -1;
public static void main(final String[] args)
package kx; //jar cf c.jar kx/*.class
import java.net.*;
import javax.net.ssl.*;
import java.io.*;
import java.sql.*;
import java.lang.reflect.Array;
import java.text.*;
import java.util.UUID;
import java.util.Calendar;
import java.util.TimeZone;
┌(yawnt@ehecatl) (node 0.10.26)
╰─(~/papers)> ls
A.Concurrent.Trace-based.Just.in.Time.Compiler.for.Single-Threaded.Javascript.pdf Lightweight.Concurrency.Working.Notes.pdf
Active.Threads.an.Extensible.Portable.Lightweight.Thread.System.pdf Lock.Free.Dynamically.Resizable.Arrays.pdf
Adding.an.LLVM.Backend.to.Bigloo.Scheme.pdf Memory.Mapped.Transactions.pdf
A.History.of.the.Virtual.Synchrony.Replication.Model.pdf Minimizing.Virtual.Machine.Support.for.Concurrency.pdf
A.LLVM.Compiler.for.CAL.pdf Minuet.a.Scalable.Distributed.Multiversion.B-Tree.pdf
A.Low.Level.Virtual.Machine.for.GHC.pdf Momoge.A.Programming.Language.Based.on.Join.Tokens.pdf
An.Efficient.Implementation.for.Coroutines.pdf Morpho.VM.An.Indirect.Threaded.Stackless.Virtual.Machine.pdf
An.On-The-Fly.Reference.Counting.Garbage.Collector.fo
-module(hello_world).
-export([start/0,pong/0]).
pong() ->
receive
stop ->
io:format("Pong finished...~n",[]);
{PingId,ping} ->
io:format("Ping~n",[]),
PingId ! {self(),pong},

Copy "exercise13.sh" into "exercise13b.sh", then modify the latter, so to capture the output of three different ls commands (of your choice) into three different variables (choosen by you), and then print them. • Writing less than three commands, writing the same command three times, and using less than three variables is considered wrong !!!

@yawnt
yawnt / proxy.js
Created September 17, 2013 11:47
var caronte = require('caronte'),
Event = require('eventemitter2').EventEmitter2,
ev = new Event({delimiter: ':'});
var proxy = caronte.createProxyServer({ ee: ev });
require('http').createServer(function(req, res) {
proxy.web(req, res, { target: 'http://mytarget.com:3000' });
}).listen(8080);
#!/usr/bin/perl
# script by karabaja4
# mail: karabaja4@archlinux.us
my $blackFG_yellowBG = "\e[30;43m";
my $blackFG_redBG = "\e[30;41m";
my $blackFG_purpleBG = "\e[30;45m";
my $yellowFG_blackBG = "\e[1;33;40m";
(def ^:dynamic *va* (fn [str] (println str)))
(defn stuff [str] (*va* str))
(stuff "hi") ; "hi"
((fn [] (binding [*va* (fn [str] (println "derp"))] (stuff "hi")))) ; "derp"