Skip to content

Instantly share code, notes, and snippets.

View sposterkil's full-sized avatar

Sam Osterkil sposterkil

  • Stateless
  • Boulder, CO
View GitHub Profile

Keybase proof

I hereby claim:

  • I am sposterkil on github.
  • I am spost (https://keybase.io/spost) on keybase.
  • I have a public key ASDabfWhlyQ0Zlj9vMnN_P-htAWS3oZJmnDngLL5QXGgfQo

To claim this, I am signing this object:

@sposterkil
sposterkil / gist:b989cb00e486fe6bc2c7acf5a63a4d1e
Created September 17, 2022 06:22
eade88c3-fcf5-4fe6-acab-2fa2e8c2d344
eade88c3-fcf5-4fe6-acab-2fa2e8c2d344
Balancing Book
0eNrtndvOHceVpF/F4DW3keuQh9Ld9MW8xGAgSG6Oh7BMChLVaKOx330oiz+paVZlroyMJClvXhmW7PxrH2pX5oqIL/7r2fc//PLix59evnrz7fevX//t2Tf/9eGf/Pzsm//1u//66797+ZfXr377xz+//Our73749Z+9+cePL5598+zlmxd/f/b82avv/v7rf3vxnz/+9OLnn29vfvru1c8/vv7pze37Fz+8eXZ//uzlq39/8Z/PvpH7/37+7MWrNy/fvHzx24r//C//+PbVL3///sVPb/8Ho7WeP/vx9c9v/++vX/16FW+XTM+f/ePZNze5359/tJqCq50uZuBi6f7ri/7nG/XN797X589++O7t/+3tP5Nv5dvvv/vhu1d/eftnnj/7jxc//fzPNUqrqk2OVPXDO5h+vbJtn87z8CI///jDyzdv3l7wh/+7fukf7k06y9n1S/x4ofTn/PTZfrySoxcm42+Kxr8p8lDflKfPVmNflc5nK+8+2xvpV+CmnSub/668/w4/f/bvL3968Zff/lU5WTujt9vplRbqzVvRDzj9/69bT9ZuyKd9epUH+mGf/i5IAj/s89UEXO2/fXP8bO2ZG+bdU+7PefzJiKEf++lXUhz9fM6Xy+A7quN7UdDb56O1R08Iiz8hdP0JcfLjPvNsuHzA7HhC6NQTYuW30riPL/ghcbpa5j0My8zPRHelStt9NXzPP7q1PH5r2WNtvt7dWka9tYx7axn11rI7ZcfVe+MK9yeuwsvJfXWX9f7m19g2C/0ZOdli9X7cflvpo61LiW23rleW7ssVxbeV460bfECJ7At9fV9YODuvW3wzW8C7MgUuvFK39A280vN74eAcEM5etyZkE6HjD0vhk7+Njx+KPooiaxvw+3C+FXXwW3D+9EUPNTbeD+X4fsi/HjUW5pY2ddbo3InafXo69RCUuYegAu03SMOn3ufZqKezA9lmEPZCOvG0FvQbnFjbIQs//A3YWybWsEnC+4iMfLvP
@sposterkil
sposterkil / ...txt
Created June 19, 2017 16:50
#just_js_things
W20170619-10:45:51.965(-6)? (STDERR) /home/spost/.meteor/packages-from-server/10.47.10.117X3000/meteor-tool/.1.4.3_2.1td3pqz++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20170619-10:45:51.966(-6)? (STDERR) throw(ex);
W20170619-10:45:51.967(-6)? (STDERR) ^
W20170619-10:45:51.967(-6)? (STDERR)
W20170619-10:45:51.967(-6)? (STDERR) Error: Cannot find module 'semver'
W20170619-10:45:51.968(-6)? (STDERR) at Function.Module._resolveFilename (module.js:325:15)
W20170619-10:45:51.968(-6)? (STDERR) at Function.Module._load (module.js:276:25)
W20170619-10:45:51.968(-6)? (STDERR) at Module.require (module.js:353:17)
W20170619-10:45:51.968(-6)? (STDERR) at require (internal/module.js:12:17)
W20170619-10:45:51.969(-6)? (STDERR) at Object.<anonymous> (/home/spost/Code/DMA-git/ui_html5_admin/src/main/meteor/.meteor/local/isopacks/routes/npm/node_modu
@sposterkil
sposterkil / po.java
Last active August 18, 2016 18:43
Page Object Example
usersPage
.clickAddUserButton() // returns AddUserPage
.enterName("Sam Osterkil") // returns AddUserPage
.enterPassword("Password") // returns AddUserPage
.clickSubmit() // returns AddUserOutcome, which is just an object with "expectValid" and "expectError" methods
.expectValid() // returns UsersPage
.selectUserFromList("Sam Osterkil") // returns UsersPage
.clickEditUserButton() // returns EditUserPage
.enterPassword("") // returns EditUserPage
.clickSubmit() // returns EditUserOutcome, which is just an object with "expectValid" and "expectError" methods
@sposterkil
sposterkil / refreshUrl.py
Created June 10, 2016 23:30
A little python script to refresh a given URL every 10 seconds
#! /usr/bin/env python3
import webbrowser
from time import sleep
url = input('Input the URL to reload, including "http://: ')
while True:
print("refreshing...")
webbrowser.open(url, new=0)
@sposterkil
sposterkil / olb.c
Created March 21, 2015 21:15
Replaced it with this
for (int i = 0; i < 10; ++i) {
if (getpid() == master_pid) {
if (fork()) {
westbound_car();
}
else if (fork()) {
eastbound_car();
}
}
}
@sposterkil
sposterkil / olb.h
Created March 21, 2015 20:27
Semaphore Ops
void olb_wait(int sem_set_id, int semaphore) {
struct sembuf vsembuf = {.sem_op = -1,
.sem_flg = 0,
.sem_num = semaphore};
if (semop(sem_set_id, &vsembuf, 1) < 0) {
perror("Failed to wait on semaphore");
exit(EXIT_FAILURE);
}
}
@sposterkil
sposterkil / olb.h
Created March 21, 2015 19:29
Counting EX
void eastbound_car() {
printf("Eastbound Car (PID: %d) spawned\n", getpid());
// Get the Semaphore set
int sem_set_id = semget(SEM_KEY, NUM_SEMS, 0777);
// Get the Shared Memory
struct common *my_shared;
int shm_id = shmget(SHM_KEY, 0, 0);
my_shared = (struct common *)shmat(shm_id, 0, 0);
printf("Cars crossed: %d\n", my_shared->xed_count);
printf("Bridge Direction: %d\n", my_shared->bridge_dir);
@sposterkil
sposterkil / olb.c
Created March 21, 2015 19:15
SHM Setup
shm_id = shmget(SHM_KEY, 1024, 0777|IPC_CREAT);
shared = (struct common *)shmat(shm_id, 0, 0);
shared->xing_count = 0;
shared->xed_count = 0;
shared->eastbound_wait = 0;
shared->westbound_wait = 0;
shared->bridge_dir = NONE;