Skip to content

Instantly share code, notes, and snippets.

View deadPix3l's full-sized avatar
👻

Skyler Curtis deadPix3l

👻
View GitHub Profile
@deadPix3l
deadPix3l / elevator.js
Created June 7, 2017 17:56
Elevator saga
{
init: function(elevators, floors) {
elevators.forEach(function(x, index){
x.on("floor_button_pressed", function(floorNum) {
if (x.currentFloor() > floorNum) {
x.goingDownIndicator(true);
x.goingUpIndicator(false);
-- HUMAN RESOURCE MACHINE PROGRAM --
init:
COPYFROM 24
COPYTO 22
BUMPUP 22
BUMPUP 22
COMMENT 0
main:
COPYFROM 22
@deadPix3l
deadPix3l / curses.py
Created March 10, 2017 14:37
Curses cheatsheet
#!/usr/bin/env python
import curses
# see 2/howto/curses.html for info.
# look into curses.textpad, which turns a window into a textbox with bindings
# look into curses.ascii for easier char handing
# the curses magical setup
stdscr = curses.initscr() # setup intial window
curses.noecho() # dont echo keystrokes
@deadPix3l
deadPix3l / aliases
Last active March 16, 2017 18:16
aliases that i havent gotten around to adding yet
##################
# PS1 uses #
##################
PS1a - \u@\h\$
PS1b - "\$ "
###########################
# useful utilities #
###########################
ping8 - ping -c4 8.8.8.8
@deadPix3l
deadPix3l / popen3
Created March 13, 2015 00:43
popen3 loops
import os
#define x and y here i guess
for i in xrange(x,y):
(out, err) = os.popen3('cmd -s %s --switch2 %s' %(i, blah))[1:]
#Note: [1:] excludes [0], stdin, because I don't care for it.
#printing out to outfile and err to .errfile goes here
#code excluded because its not the main focus here