Skip to content

Instantly share code, notes, and snippets.

View ChrisMorrisOrg's full-sized avatar

Chris Morris ChrisMorrisOrg

View GitHub Profile
@robey
robey / apple1-rom.txt
Last active May 22, 2023 03:49
apple 1 ROM disassembly
;
; the "monitor ROM" of an apple 1 fit in one page (256 bytes).
;
; this is my attempt to take the disassembled code, give names to the
; variables and routines, and try to document how it worked.
;
;
; an apple 1 had 8KB of RAM (more, if you hacked on the motherboard), and a
; peripheral chip that drove the keyboard and video. the video was run by a
; side processor that could treat the display as an append-only terminal that
@dmnsgn
dmnsgn / .eslintrc.js
Created July 23, 2015 13:31
.eslintrc Google JavaScript Style Guide (eslint v0.24.1)
{
// http://eslint.org/docs/rules/
"env": {
"browser": true, // browser global variables.
"node": false, // Node.js global variables and Node.js-specific rules.
"worker": false, // web workers global variables.
"amd": false, // defines require() and define() as global variables as per the amd spec.
"mocha": false, // adds all of the Mocha testing global variables.
"jasmine": false, // adds all of the Jasmine testing global variables for version 1.3 and 2.0.
@ChrisMorrisOrg
ChrisMorrisOrg / TriAlphAngle
Created February 7, 2013 03:10
Because loops are fun.
<?php
function trialphangle(){
$characters = "abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+_)(*&^%$#@!~=-`|}{\":?><\][';/.,";
$len = 2;
for($i = 0; $i < $len; $i++){
for($j = 0; $j < strlen($characters); $j++){
print substr($characters, $j, $j+2)."\n";
}
}
@ChrisMorrisOrg
ChrisMorrisOrg / FakeChat
Last active December 10, 2015 15:08
Given some text, this function will print out the text as if the computer is typing it live, in front of you.
def fakeChat(text):
# Set SPEED_VARIANCE to 0.001 for low variance, 10 for high variance
SPEED_VARIANCE = 0.1
x = 0
rate = 1
# Ensure clean input
text = str(text)
rate = int(rate)
while x < len(text):
@ChrisMorrisOrg
ChrisMorrisOrg / ColourfulShell
Last active January 15, 2024 03:09
Colourise and highlight text in your Python app when running through shell.
# Colourise - colours text in shell. Returns plain if colour doesn't exist.
def colourise(colour, text):
if colour == "black":
return "\033[1;30m" + str(text) + "\033[1;m"
if colour == "red":
return "\033[1;31m" + str(text) + "\033[1;m"
if colour == "green":
return "\033[1;32m" + str(text) + "\033[1;m"
if colour == "yellow":
return "\033[1;33m" + str(text) + "\033[1;m"