Skip to content

Instantly share code, notes, and snippets.

View oderwat's full-sized avatar
💭
Go da Lang...

Hans Raaf oderwat

💭
Go da Lang...
View GitHub Profile
@PhilipWitte
PhilipWitte / app.nim
Last active August 8, 2016 07:24
"Brim" - Nim version of maikklein's 'Breeze' ECS
import brim
# ---
type
Position = object
x, y: float
Velocity = object
@fowlmouth
fowlmouth / xcurry.nim
Last active August 9, 2020 05:09
nim getType() fun
# here is an implementation of curry, arguments passed are wrapped up in a new
# closure and a function is returned that accepts the remaining arguments
# usage:
# proc foo (a,b: int): int = a + b
# let f = curry(foo, 10)
# assert f(10) == 20
#
# note: to use an overloaded function you must annotate its type
# curry((proc(c:char,len:int):string)strutils.repeat, 'x')
#
@jessitron
jessitron / haskellyte.md
Created August 1, 2014 16:12
Gershom's Letter to a Young Haskell Enthusiast, condensed. I removed a lot of words, kept the themes, moved a few around a bit.

Letter to a Young Haskell Enthusiast, by Gershom Bazerman.

Condensed from: http://comonad.com/reader/2014/letter-to-a-young-haskell-enthusiast/

The following letter is about tendencies that come with the flush of excitement of learning any new thing. It is written specifically, because if we don't talk specifics, the generalities make no sense. It is a letter full of things I want to remember.

You’ve entered the world of strongly typed functional programming, and it is great. You want to share the great things you’ve learned, and you want to slay all the false statements in the world.

@henryiii
henryiii / git-all.bash
Last active April 29, 2023 15:13
Fast repository status for repos in git folder
#!/usr/bin/env bash
# This script should be named (or symbolically linked) as git-all so that
# it can be run as a git command (if it is in the path). The repo location should
# be set in REPOLOC. Can be relative if this script is also in a repo!
# Standard bash stuff to get the current directory
unset CDPATH
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
@pixelhandler
pixelhandler / pre-push.sh
Last active April 8, 2024 01:04
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`