Skip to content

Instantly share code, notes, and snippets.

View alecnunn's full-sized avatar
🏳️‍🌈

Alec Nunn alecnunn

🏳️‍🌈
View GitHub Profile
@alecnunn
alecnunn / semantic-commit-messages.md
Created September 27, 2021 18:11 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@alecnunn
alecnunn / vm.c
Created December 31, 2016 22:33 — forked from jmiserez/vm.c
X86 (subset) interpreter, prototype. Reads instructions from plaintext file, instructions separated by spaces.
/*
* vm.c - Simple X86 interpreter
*
* Copyright (c) 2013, Jeremie Miserez <jeremie@miserez.org>
*/
/*
* Highlights/Features not specified in assignment
* ===============================================
* - Memory simulation of all 4GB with paging
#A golfed python 'accent'. Fully backwards compatible with python.
#NOT SUITED FOR DAY-TO-DAY PROGRAMMING!
#If you DO use it for a production (non-challenge/codegolf) program, I'm not
#responsible for anything bad that happens to you, your computer,
#your spare time, your code maintainability, any kittens that god might kill,
#or the tears of blood you will weep.
import sys
from math import *
@alecnunn
alecnunn / tnt-miner-solutions.tx
Last active December 17, 2015 10:18 — forked from danneu/tnt-miner-solutions.tx
added another thousand or so
hItuE25058127
6uGdS64633551
iZ8Yg129410073
mn9Ni177063744
tvUy62899300
LlcJs181693848
rRNp274174151
UsiSz5027013
DH4Yd88472413
eEIN376415610
@alecnunn
alecnunn / tinystackr3.py
Created July 17, 2012 04:52 — forked from vgel/tinystackr3.py
Tiny stack-based language in python.
stack = []
compileStacks = []
words = {}
builtins = {}
lambdaType = type(lambda x: x) #cannot compare against the function type directly for some reason
def prn(o):
print(o)
def clr(l):
@alecnunn
alecnunn / mrisc.rb
Created July 17, 2012 04:51 — forked from pachacamac/mrisc.rb
A Simple Assembler Language and VM
#!/usr/bin/env ruby
class MRISC
def run(code)
tokens = code.gsub(/(\*.*?\*)|[^a-z0-9,-;@\._]/,'').split(';')
@vars,stack,i = {:_pc=>-1,:_oc=>0},[],0
tokens.map!{|t| t.chars.first=='@' ? (@vars[t.to_sym]=i-1;nil) : (i+=1;t.split(',').map{|e|numeric?(e) ? e.to_i : e.to_sym})}.compact!
while @vars[:_pc] < tokens.size-1
@vars[:_pc] += 1
@vars[:_oc] += 1
@alecnunn
alecnunn / short.py
Created July 17, 2012 04:51 — forked from darkf/short.py
nanoshorten
# nanoshorten - a very tiny URL shortener Web application written in Bottle and sqlite
# copyright (c) 2012 darkf
# licensed under the WTFPL (WTF Public License)
# see http://sam.zoy.org/wtfpl/ for details
from bottle import get, request, run
import sqlite3, random, string
con = sqlite3.connect('short.db')
c = con.cursor()
@alecnunn
alecnunn / random_imgur.py
Created July 17, 2012 04:51
random imgur downloader (v2 with threading!) e: fixed a bug, removed tabs :)
import os
import sys
import random
import time
import string
import Queue
import threading
from urllib2 import Request, urlopen, URLError, HTTPError
CHARS = string.letters + string.digits