Skip to content

Instantly share code, notes, and snippets.

View GPHemsley's full-sized avatar
🦁
Truth be told, I'm a lion (rawr)

Gordon P. Hemsley GPHemsley

🦁
Truth be told, I'm a lion (rawr)
View GitHub Profile
@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 (doppelheathen@gmail.com)
;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

Rust Error Handling Cheatsheet - Result handling functions

Introduction to Rust error handling

Rust error handling is nice but obligatory. Which makes it sometimes plenty of code.

Functions return values of type Result that is "enumeration". In Rust enumeration means complex value that has alternatives and that alternative is shown with a tag.

Result is defined as Ok or Err. The definition is generic, and both alternatives have

@gavinsharp
gavinsharp / dominant-color.js
Created June 9, 2011 17:06 — forked from leibovic/dominant-color.js
Dominant Color
function getDominantColor(aImg) {
let canvas = document.createElement("canvas");
canvas.height = aImg.height;
canvas.width = aImg.width;
let context = canvas.getContext("2d");
context.drawImage(aImg, 0, 0);
// keep track of how many times a color appears in the image
let colorCount = {};
@GPHemsley
GPHemsley / python_collections.mediawiki
Last active August 29, 2015 13:57
Table of collection data types in Python
container ordered members? unique members? immutable type? used for keys in
No
No