Skip to content

Instantly share code, notes, and snippets.

View sroccaserra's full-sized avatar
🐿️

Sébastien Roccaserra sroccaserra

🐿️
View GitHub Profile
@VaughnVernon
VaughnVernon / CONTENTS.md
Last active November 20, 2024 10:10
Hexagonal / Ports and Adapters Is Just This Simple
function _draw()
cls(8)
srand(5)
-- Iterate every 8 square pixels of the screen.
-- The `.5` is to make sure the points are at the center of each pixel.
-- We'll draw one wall of the maze in each square.
for y=.5,129,8 do
for x=.5,129,8 do
-- Progress in the rotation cycle. One rotation is [0..1]
-- draw a mode7 style floor
scene = {x=10,y=10,z=140,hz=25,rot=0,spd=0}
-- fade table http://kometbomb.net/pico8/fadegen.html
local fadetable={
{0,0,129,129,129,129,1},
{1,1,1,1,1,1,1},
{2,2,133,133,133,1,1},
@bChiquet
bChiquet / .hs
Created January 17, 2020 09:30
aoc_2
module Lib
( Program
, Cursor
, eval
, (|+|)
, at, writeIn
, Value(..)
) where
import Control.Monad (liftM2)
@FaustXVI
FaustXVI / tcrdd.sh
Created December 14, 2018 13:57
TCR merged with TDD
#!/usr/bin/env bash
BRANCH=origin/master
TEST_KEYWORD="Expect"
function runTest() {
./node_modules/.bin/elm-test
}
# look for a new test in a + line in the diff
function testJustAdded(){
@djfm
djfm / chain-do.js
Last active September 23, 2016 13:24
const chainStep = fn => (argSource, history) => {
if (argSource && (typeof argSource === 'object')) {
const then = argSource.then;
if (typeof then === 'function') {
return Promise.all(history).then(
settledHistory =>
then.call(argSource, arg => fn(arg, ...settledHistory))
);
}
}
@djfm
djfm / monad.js
Created July 25, 2016 11:25
incomplete but fun monad implementation attempt
const chai = require('chai');
chai.should();
const listMonad = {
// make :: a -> m a
// make :: a -> [a]
make: (...args) => args,
// bind :: m a -> (a -> m b) -> m b
// bind :: [a] -> (a -> [b]) -> [b]
bind: someList => listReturningFunction =>
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no