Skip to content

Instantly share code, notes, and snippets.

View Colouratura's full-sized avatar

Abish Colouratura

  • Detroit, Michigan
  • 22:22 (UTC -04:00)
View GitHub Profile
@Colouratura
Colouratura / cal.c
Created May 10, 2022 13:22
A simple RPN calculator in C
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
struct stack {
size_t size;
double *buff;
};
@Colouratura
Colouratura / hello-input.s
Created May 10, 2022 02:54
Hello with input in NASM assembly for x86-64 linux with the common ABI
; Build:
; ~$ nasm -felf64 hello-input.s -o hello-input.o
; ~$ ld hello-input.o
; ~$ ./a.out
global _start
section .data
null: equ 0x0
stdoutf: equ null
@Colouratura
Colouratura / helloworld.asm
Created May 9, 2022 03:03
Simple MASM program to output hello world
; NOTE: to successfully build you must have a copy of kernel32.lib in the same directory!
; build:
; ml64 helloworld.asm /link /subsystem:console /entry:main
includelib kernel32.lib ; library - kernel functions (Windows Kit) (directory relative)
; external functions and handles
GetStdHandle proto ; function - gets an output handle
WriteConsoleA proto ; funciton - writes to a console handle
ExitProcess proto ; function - exits the current process
@Colouratura
Colouratura / TwitterTheAlgorithmMeme.js
Created April 26, 2022 00:41
The future of enterprise software.
class TwitterExtensibleError extends Error {
constructor(message) {
super(message)
this.name = this.constructor.name
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = (new Error(message)).stack;
}
@Colouratura
Colouratura / rpncal.vb
Created April 24, 2022 00:55
Simple reverse polish notation calculator written in VB.NET (no division support!)
Imports System
Module Program
Sub PrintHelp()
Console.WriteLine("rpncalc - version 0.1 - 2022")
Console.WriteLine("To use: type integer or operator")
Console.WriteLine("")
Console.WriteLine("Operators:")
Console.WriteLine(" + Adds all values on the stack together.")
Console.WriteLine(" - Substracts all values on the stack from each other.")
@Colouratura
Colouratura / canvas.js
Last active April 4, 2022 23:45
A small experiment in the Canvas ImageData api
class Frame {
constructor(width, height, pallet) {
this.width = width
this.height = height
this.pallet = pallet
this.buffer = new Uint8ClampedArray((width * height) * 4)
}
asBytes() {
return this.buffer
@Colouratura
Colouratura / sketch.go
Last active October 16, 2017 04:27
A thing
/*
NAME
sketch - sketch an image
SYNOPSIS
sketch [-l -p -save -stat] [file]
DESCRIPTION
Sketch approximates the input image using randomly placed lines.
var UserTags = function () {
return this;
};
/**
* __renderTemplate
* renderTemplate invokes a small template engine that turns an HTML string
* into an HTML string with the templates substituted with the escaped values
* of the template data.
*
var CheckAdoptions = function () {
this._adoptions = [];
this._concerns = [];
return this;
};
CheckAdoptions.prototype.__fetchAdoptionsList = function () {
if (this._adoptions.length > 0) {
this._adoptions = [];
this._concerns = [];
@Colouratura
Colouratura / Zion.js
Last active October 4, 2017 21:48
The script loader for Wikia that lets you use ES6 like an actual person
(function (window, document, mw) {
var ZION = function () {
this._scripts = [];
this.loaded = this.loaded();
return this;
};
ZION.prototype._getScriptURL = function (script) {
var split = script.split(':');