Skip to content

Instantly share code, notes, and snippets.

View rightfold's full-sized avatar
🎯
Finally focussing

rightfold rightfold

🎯
Finally focussing
  • Utrecht, Netherlands
View GitHub Profile
@hodzanassredin
hodzanassredin / Functor.cs
Created September 30, 2011 13:23
Trying to workaround missed higher-kinded type parameters in c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FunctorTest
{
public interface SingleParamPolymorph<T> { }
public interface TwoParamsPolymorph<T, U> { }
@codification
codification / proc.clj
Created March 6, 2012 08:10
Clojure asynchronous process
(ns proc
(:import [java.lang ProcessBuilder])
(:use [clojure.java.io :only [reader writer]]))
(defn spawn [& args]
(let [process (-> (ProcessBuilder. args)
(.start))]
{:out (-> process
(.getInputStream)
(reader))
@puffnfresh
puffnfresh / do.sjs
Created October 4, 2012 04:40
do-notation using sweet.js
macro $do {
case { $y:expr } => {
$y
}
case { $x:ident <- $y:expr $rest ... } => {
λ['>=']($y, function($x) {
return $do { $rest ... }
});
}
}
@rmartinho
rmartinho / fast.c++
Last active December 16, 2015 02:39
“I want it as fast as possible”
int main(){}
@willurd
willurd / web-servers.md
Last active July 6, 2024 23:56
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kseo
kseo / recon.ml
Last active March 28, 2024 14:41
A Hindley-Milner type inference implementation in OCaml
#! /usr/bin/env ocamlscript
Ocaml.ocamlflags := ["-thread"];
Ocaml.packs := [ "core" ]
--
open Core.Std
type term =
| Ident of string
| Lambda of string * term
| Apply of term * term

OpenCart Issue #1286

This is the full version of the thread for opencart#1286, archived from notification emails.
The discussion has since been deleted almost entirely by OpenCart's developer.
Everyone who posted in it has also been blocked from the OpenCart repo.


Damian Bushong

@kane-thornwyrd
kane-thornwyrd / gist:3963c321845a685cf7b6
Last active August 29, 2015 14:08
Coffeescript Syntactic Diabetes
inside = (what, from)=>
if typeof window isnt 'undefined'
window[what] = from
else
global[what] = from
we = (obj)-> obj
load = (thing)=> inside thing, we require thing
inside '$', we require 'jquery'
load 'assert'
@rightfold
rightfold / gist:2011e40f6e9fb3ff8fb5
Created June 18, 2015 07:30
Publish–subscribe in Go
package main
import (
"fmt"
"sync"
"time"
)
type Publisher struct {
mutex sync.RWMutex