Skip to content

Instantly share code, notes, and snippets.

View fumieval's full-sized avatar
🐦
Birb

Fumiaki Kinoshita fumieval

🐦
Birb
View GitHub Profile
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@mpickering
mpickering / gist:e13f343f2b35b51693d15582180b1c02
Last active September 19, 2019 13:10
Simple GHC API executable
module Main where
import GHC as G
import GhcMake as G
import DynFlags
import SrcLoc as G
import GHC.Paths
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.State
type Name = String
data Type =
TInt|
TBool|
TVar Name|
TFun Type Type deriving (Show, Eq)
data Expr =
EInt Int|
@pasberth
pasberth / BrainfuckCompiler.hs
Last active December 18, 2015 20:39
Brainfuck を LLVM にコンパイルするやつ
{-# LANGUAGE LambdaCase #-}
import Control.Monad
import Control.Monad.State
import Control.Lens
import Data.List
import System.Environment
type Instr = Char
type Code = [Instr]
(ns macro-combinator
(:refer-clojure :exclude [=]))
(defn prim [x] (fn [a] `(fn [~x] ~a)))
(defn in [v a] (v a))
(defn where [a v] (v a))
(defn = [v b] (fn [a] `(~(v a) ~b)))
(defn <- [v b] (fn [a] `(>>= ~b ~(v a))))
(println (in (= (prim 'x) 42) 'x))
; ((clojure.core/fn [x] x) 42)
@aaronwolen
aaronwolen / slides.md
Last active November 11, 2022 23:57
Pandoc template to generate reveal.js slideshows.

% Title % Name % Date

My first slide

List

@shangaslammi
shangaslammi / hello-ski.hs
Created August 23, 2012 16:53
Hello World using SKI combinator calculus
s x y z = x z (y z)
k x y = x
i = s k k
c = s (s (k (s (k s) k)) s) (k k)
b = s (k s) k
hello =
s(s(k s)(s(k k)(s(k s)(s(k(s(k s)))(s(s(k s)(s(k k)(s(k b)i)))(k(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s
b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(c k))))))))))))))))))))))))))))))))))))))))))
)))))))))))))))))))))))))))(s(s(k s)(s(k k)(s(k s)(s(k(s(k s)))(s(s(k s)(s(k k)(s(k b)i)))(k(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s b(s
@jboner
jboner / latency.txt
Last active May 2, 2024 09:45
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@yatt
yatt / skiplist.py
Created April 6, 2012 10:50
skiplist.py
#! /usr/bin/python2.6
# coding: utf-8
# ref: http://live-e.naist.jp/sensor_overlay/5/doc/yoshida.pdf
# ref: http://en.wikipedia.org/wiki/Skip_list
# ref: http://msdn.microsoft.com/en-us/library/Aa289151
# 利点
# バランス操作が不要
# lock-free