This file contains hidden or 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
#!/bin/sh | |
# This script creates a bundle of git commits between START and END. | |
# It also tars the lfs files that changed in those commits. | |
# When you unbundle on the receiving side you should untar the LFS tar *before* | |
# running 'git pull' on the bundle file. | |
# Note that this is just an example script that doesn't do error checking, and | |
# also doesn't account for submodules, etc. YMMV | |
# Start and end commits of bundle |
This file contains hidden or 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 std.stdio; | |
import std.conv; | |
import std.string; | |
struct Regs { | |
uint a, b, c, d; | |
} | |
Regs cpuid(uint eax) { | |
Regs r; |
This file contains hidden or 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
;;;; Freer monad in Scheme | |
;;;; See also | |
;;;; * "Freer monads, more extensible effects" | |
;;;; http://dl.acm.org/citation.cfm?doid=2804302.2804319 | |
;;;; * Free monad in Scheme https://gist.github.com/wasabiz/951b2f0b22643a59aeb2 | |
(use gauche.record) | |
(use util.match) | |
;;; data Freer f a where | |
;;; Pure :: a -> Freer f a |
This file contains hidden or 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 (gauche partcont) | |
(scheme base) | |
(scheme write)) | |
;;; generic fmap | |
(define *fmap-methods* | |
`((,list? . ,map))) |
This file contains hidden or 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
ZigZag-Encoding | |
--------------- | |
Maps negative values to positive values while going back and | |
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...) | |
(i >> bitlength-1) ^ (i << 1) | |
with "i" being the number to be encoded, "^" being | |
XOR-operation and ">>" would be arithemtic shifting-operation |
There was a [great article][1] about how react implements it's virtual DOM. There are some really interesting ideas in there but they are deeply buried in the implementation of the React framework.
However, it's possible to implement just the virtual DOM and diff algorithm on it's own as a set of independent modules.