Skip to content

Instantly share code, notes, and snippets.

View nitrix's full-sized avatar

Alex Belanger nitrix

View GitHub Profile
(interpreter) Running memcheck: underscore
==26617== Memcheck, a memory error detector
==26617== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==26617== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==26617== Command: chaos /root/chaos/tests/underscore.kaos
==26617==
1
2
3
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 8);
glEnable(GL_MULTISAMPLE);
/*
* ████████╗ ██████╗ ██████╗ ██╗ ██╗ ██╗██╗████████╗
* ╚══██╔══╝██╔═══██╗██╔═══██╗██║ ██║ ██╔╝██║╚══██╔══╝
* ██║ ██║ ██║██║ ██║██║ █████╔╝ ██║ ██║
* ██║ ██║ ██║██║ ██║██║ ██╔═██╗ ██║ ██║
* ██║ ╚██████╔╝╚██████╔╝███████╗██║ ██╗██║ ██║
* ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝
*
* Alex Belanger (nitrix)
* https://github.com/nitrix/toolkit
@nitrix
nitrix / gist:64e307cd448af069f80185df80c63182
Created December 16, 2019 05:25
Go image pkg overhead vs array
package main
import (
"fmt"
"image"
"image/color"
"time"
)
func main() {
func triangularNumberOf(n int) int {
return n * (n + 1) / 2
}
func reverseTriangularNumberOf(sum int) int {
n := (math.Sqrt(8 * float64(sum) + 1) - 1) / 2
return int(math.Ceil(n))
}
@nitrix
nitrix / gist:ff6cacbe5790605f4e61dbe9dda5e9e2
Created May 1, 2019 19:27
Bash profile useful aliases at work
# Docker Compose
# Runs a docker command of your choice from anywhere.
#
# Usage: dc <command>
dc() {
docker-compose --project-directory ~/Documents/Repos/workspace -f ~/Documents/Repos/workspace/docker-compose.yml $@
}
# Docker Compose Restart.
# Restart a container by name.
; Turn nasm into 16-bit mode
BITS 16
; Set origin address
ORG 0x7C00
; MEMORY LAYOUT
; 0x0000 - 0x0500 Interrupt Vector Table, BIOS Data Area
; 0x0500 - 0x7C00 Stack (growing down)
; 0x7C00 - 0x7E00 First stage bootloader
; 0x7E00 - 0xFFFF Free for use!
dc() {
docker-compose --project-directory ~/Documents/Repos/ws-development -f ~/Documents/Repos/ws-development/docker-compose.yml $@
}
# Docker compose restart
dcr() {
dc kill "$1"
dc up -d "$1"
}
@nitrix
nitrix / SKI.hs
Created October 31, 2018 20:55 — forked from Solonarv/SKI.hs
module SKI where
data SKI = S | K | I | A SKI SKI
deriving (Eq, Show)
reduce :: SKI -> SKI
reduce (A (A (A S x) y) z) = reduce (A (A x z) (A y z))
reduce (A (A K x) y) = reduce y
reduce (A I x) = reduce x
reduce a@(A f x) = let f' = reduce f in if f==f' then a else reduce (A f' x)
@nitrix
nitrix / keybase.md
Last active October 28, 2018 17:07
keybase.md

Keybase proof

I hereby claim:

  • I am nitrix on github.
  • I am nitrix (https://keybase.io/nitrix) on keybase.
  • I have a public key whose fingerprint is 6B82 F2F3 1479 D465 AEBF F52A 0AFB A2E7 FA59 5691

To claim this, I am signing this object: