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
@yyscamper
yyscamper / quote.py
Last active December 12, 2019 10:35
SQLAlchemy Postgresql Quote Identifier
from sqlalchemy import create_engine
engine = create_engine('postgresql://user:passwd@127.0.0.1:5432/dbname')
engine.dialect.identifier_preparer.quote('table')
engine.dialect.identifier_preparer.quote_identifier('table')
@paf31
paf31 / Main.hs
Last active September 5, 2018 03:54
A simple type checker with Rank N types
module Main where
import Data.Maybe (fromMaybe)
import Control.Applicative
import Control.Arrow (first)
import Control.Monad (ap)
import Debug.Trace
@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
@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'

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

@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
@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
@rmartinho
rmartinho / fast.c++
Last active December 16, 2015 02:39
“I want it as fast as possible”
int main(){}
@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 ... }
});
}
}