Skip to content

Instantly share code, notes, and snippets.

View MSylvia's full-sized avatar
💭
Compiling ....

Matt Sylvia MSylvia

💭
Compiling ....
View GitHub Profile
@MSylvia
MSylvia / find_rects.cpp
Created March 18, 2017 15:56 — forked from pelya/find_rects.cpp
Find all rectangles in a 2D array, trying to cover as much area with as little amount of rectangles as possible. http://stackoverflow.com/questions/5810649/finding-rectangles-in-a-2d-block-grid
#include <stdlib.h>
#include <vector>
#include <utility>
#include <algorithm>
#include "find_rects.hpp"
namespace FindRects {
/* Algorithm was taken from here: http://stackoverflow.com/a/20039017/624766
#
# Makefile
# AssemblyTest
#
# Part of a sample build pipeline for Apple ][ software development
#
# Created by Quinn Dunki on 8/15/14.
# One Girl, One Laptop Productions
# http://www.quinndunki.com
# http://www.quinndunki.com/blondihacks
@MSylvia
MSylvia / latency.txt
Created June 16, 2017 14:53 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@MSylvia
MSylvia / rltiles.lua
Created July 4, 2017 14:21 — forked from usysrc/rltiles.lua
roguelike ascii tile display
local data = love.image.newImageData("Alloy_curses_12x12.png")
data:mapPixel(function(x,y,r,g,b,a)
if r == 255 and b == 255 and g ~= 255 then
r,g,b,a = 0,0,0,0
end
return r,g,b,a
end)
local img = love.graphics.newImage(data)
local spritebatch = love.graphics.newSpriteBatch(img, 87*25, "stream")
@MSylvia
MSylvia / mvm.lua
Created July 4, 2017 14:22 — forked from usysrc/mvm.lua
micro vm in lua
local MEM = {}
local PC = 0
local registers = {
A = 0,
B = 0,
C = 0,
D = 0
}
local fetch = function()
@MSylvia
MSylvia / SMBDIS.ASM
Created October 16, 2017 18:22 — forked from 1wErt3r/SMBDIS.ASM
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
@MSylvia
MSylvia / croutonGamepadFix.md
Created November 3, 2017 16:45 — forked from matt-allan/croutonGamepadFix.md
setup dragonrise controllers with crouton

To make dragonrise n64 and snes controllers work with my crouton xfce4/ubuntu chroot, I had to recompile the kernel with support for the hid_dr module. These are the steps to get the controllers working. Almost all steps are taken from the sources listed below. All commands are entered in the chroot's terminal, not the chronos shell.

sudo apt-get install git-core make kernel-package
cd ~
git clone https://chromium.googlesource.com/chromiumos/third_party/kernel -b chromeos-3.8
cd kernel
nano chromeos/config/base.config

type ctrl-w, type 'error_on_warning' and press enter to find the line you need to edit.

@MSylvia
MSylvia / 32.asm
Created January 30, 2018 15:00 — forked from FiloSottile/32.asm
NASM Hello World for x86 and x86_64 Intel Mac OS X (get yourself an updated nasm with brew)
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32
global start
section .text
start:
push dword msg.len
push dword msg
push dword 1
mov eax, 4
@MSylvia
MSylvia / hello-boot.asm
Created January 30, 2018 15:02 — forked from yackx/hello-boot.asm
Hello World bootloader in assembly language
;----------------------------------------------;
;
; A minimal bootloader that prints a hello world
; then halts.
;
; nasm -f bin hello-boot.asm -o hello-boot.bin
;
; @YouriAckx
;
;----------------------------------------------;
@MSylvia
MSylvia / mk.osx.iso.sh
Created March 6, 2018 21:17 — forked from un33k/mk.osx.iso.sh
Make_OSX_Installable_ISO
#!/bin/bash
# Use with care ...
OS="Yosemite"
IMG_SIZE=8g
BUILD_MNT=/tmp/"$OS"_Build
INSTALL_MNT=/tmp/"$OS"_Install
INSTALL_DMG=/Applications/Install\ OS\ X\ "$OS".app/Contents/SharedSupport/InstallESD.dmg