Skip to content

Instantly share code, notes, and snippets.

hjpotter92

Block or report user

Report or block hjpotter92

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hjpotter92
hjpotter92 / preferences.sublime-settings
Last active Jun 8, 2016
Sublime Text 2 user settings
View preferences.sublime-settings
{
"auto_complete_commit_on_tab": true,
"auto_match_enabled": true,
"bold_folder_labels": true,
"close_windows_when_empty": true,
"default_line_ending": "unix",
"dictionary": "Packages/Language - English/en_UK.dic",
"ensure_newline_at_eof_on_save": true,
"font_face": "Consolas",
"font_size": 10,
View Hi-Lo.lua
math.randomseed( os.time() )
local Random, Read, Write = math.random, io.read, io.write
Write "Number of players -> "
local tPlayers, iNumPlayers = {}, Read '*n'
Write "How many rounds? -> "
local iRounds = Read '*n'
io.input():flush()
@hjpotter92
hjpotter92 / NumberToString.lua
Last active Jan 22, 2017
Convert a number to equivalent string representation
View NumberToString.lua
NumberToString = (function ()
local insert, concat, floor, abs = table.insert, table.concat, math.floor, math.abs
local num, tens, bases = {
'one',
'two',
'three',
'four',
'five',
'six',
'seven',
View gist:9802333
d49fb3538ee71a430123
ea9e0d6b9053a8b1367b
@hjpotter92
hjpotter92 / .rcbash
Last active May 23, 2016
Git Bash profile settings.
View .rcbash
source ~/git-prompt.sh
source ~/git-completion.bash
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
export GIT_PS1_SHOWSTASHSTATE=true
export GIT_PS1_SHOWUPSTREAM=verbose
PS1=$'\[\e[0m\]\u250c\u2500[$([[ $? != 0 ]] && echo "\[\e[1;31m\]\u2717\[\e[0m\]" || echo "\[\e[1;32m\]\u2714\[\e[0m\]")]\u2500[\[\e[0m\]\[\e[1;36m\]\u\[\e[0m\]@\[\e[1;35m\]\h\[\e[0m\]]\u2500[\[\e[4;33m\]\W\[\e[0m\]]\u2500[\[\e[1;33m\]\@\[\e[0m\]]\[\e[0m\]$(__git_ps1)\n\[\e[0m\]\u2514\u2500\u2500\[\e[1;36m\]\$\[\e[0m\] '
# custom alias list
# ls, clear etc.
View instruction
ADD 111
SUB 112
MOV 113
XOR 114
CMP 115
@hjpotter92
hjpotter92 / DISPSTR.asm
Last active Dec 22, 2015
2013-09-09: Read two strings and check whether one of them is a subtring of other or not
View DISPSTR.asm
DISP_STR PROC
SAVE_REG <AX, CX, DX, SI>
MOV CX, BX
CLD
MOV AH, 2
DISP_LOOP:
LODSB
MOV DL, AL
INT 21H
@hjpotter92
hjpotter92 / assignment.asm
Created Aug 27, 2013
2013-08-26: Systems programming lab assignment.
View assignment.asm
TITLE Lab05: Read array of integers and display recurring elements
.MODEL SMALL
.STACK 100H
.DATA
CR EQU 13
LF EQU 10
View array sort.asm
TITLE Sort: Program to sort numbers as they are inputted by user
.MODEL SMALL
.STACK 100H
.DATA
MyARR DW 200 DUP(?)
PROMPT DB 10, 13, "Input number? (Press N to quit): $"
SEP DB ", $"
LST DB 10, 13, "Current array has: $"
CR EQU 13
@hjpotter92
hjpotter92 / Program01.asm
Last active Dec 20, 2015
Take a number as input and print it To be shown on 2013-08-12
View Program01.asm
TITLE Program01: Take a number as input and print it
.MODEL SMALL
.STACK 100H
.DATA
PROMPT DB "Please input the number: ", 13, 10, '$'
CR EQU 13
LF EQU 10
You can’t perform that action at this time.