Skip to content

Instantly share code, notes, and snippets.

@prozacgod
prozacgod / driver.py
Created February 18, 2021 06:09
I remember writing games like this in rom basic, and thought "there's not enough stupidly simple text mode games around" wanted to get back to my roots a bit. I shared with with a group of young adults to see if I could inspire them to code, and it may have worked!!
#!/usr/bin/env python3
import sys
import time
import random
import select
import termios, fcntl
import atexit
import os
posx = 40
@prozacgod
prozacgod / SpaceEngineerModList.txt
Last active April 26, 2020 21:28
My list of Space Engineers mods for multiplayer
Control Module - basically key binding for ships
https://steamcommunity.com/sharedfiles/filedetails/?id=655948251
1x1x1 Merge Block
https://steamcommunity.com/sharedfiles/filedetails/?id=687617157
Concrete Tool - placing voxels in surviva
https://steamcommunity.com/sharedfiles/filedetails/?id=396679430
Wing Parts
@prozacgod
prozacgod / example.c
Created April 24, 2020 01:05
Calling a callback sent from lua to c
// taken from here https://stackoverflow.com/a/21947358 and made into single file
// I was using luajit like this from my own game's code gcc example.c -L ./luajit/LuaJIT-2.0.5/src/ -lluajit
#include <stdio.h>
#include <stdlib.h>
#include "./luajit/LuaJIT-2.0.5/src/lua.h"
#include "./luajit/LuaJIT-2.0.5/src/lauxlib.h"
#include "./luajit/LuaJIT-2.0.5/src/lualib.h"
@prozacgod
prozacgod / tubing_planner.js
Last active April 14, 2020 17:15
Parametric Windowed Tubing for 3d Printed Cooling loop (OpenJSCAD)
// title : OpenJSCAD.org Logo
// author : Prozacgod
// license : MIT License
// revision : 0.001
// file : jscad
// This was inspired by https://www.youtube.com/watch?v=LDk4XcMztf0
// I figured a parametric version of a tube planner would be nice, started with 90 turns
// you can define things such as window count, inner diameter outter diameter and the radius of the turn
//
@prozacgod
prozacgod / video speed
Created March 29, 2020 06:02
Use this bookmarklet to speed up embedded videos
I normally create a bookmarklet "Scripts" folder in chrome toolbar, and then add these as labelled.
1.0
javascript:(function(){document.getElementsByTagName('video')[0].playbackRate=1.0})();
1.5
javascript:(function(){document.getElementsByTagName('video')[0].playbackRate=1.5})();
2.0
javascript:(function(){document.getElementsByTagName('video')[0].playbackRate=2.0})();
@prozacgod
prozacgod / test-react.user.js
Last active November 7, 2019 15:13
Testing react bug with dev libraries not working in tampermonkey environment.
// ==UserScript==
// @name Test react bug with dev module
// @version 0.1
// @description React Development
// @author Prozacgod
// @match http://localhost:8080/
// @grant unsafeWindow
// @grant GM_registerMenuCommand
// @grant GM_xmlhttpRequest
@prozacgod
prozacgod / Program.cs
Created April 11, 2019 04:09
My first attempt at some dotnetcore / linux program that creates a database / tables using postgresql and entityframework
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
namespace testApp
{
public class AppContext : DbContext
{
public DbSet<Client> Clients { get; set; }
@prozacgod
prozacgod / README.md
Created April 3, 2019 16:33 — forked from francoishill/README.md
PEG Grammar for Command Line Parsing

Command Line Parsing Grammar

This grammar allows you to parse command lines for program execution into their various components - specifically: environment variables, the executable itself and any arguments passed to the executable.

It will take an input like the following:

ENV_X=true ENV_Y="yes please" ./test/my_exec arg1 -f1 "arg with spaces" 'another arg' --flag2 yet\ another\ arg --flag=10
@prozacgod
prozacgod / get_xauth.sh
Last active September 4, 2018 01:01
Just a quicky that I use to get my xauthority file remotely, combined with other script or things like x11vnc, helps when I'm remote and need to login through gdm too
#!/bin/bash
OWNER=`id -u`
if [[ -n "$1" ]]; then
OWNER=$1
fi
ps ax | grep auth | grep $OWNER | python -c "import sys; print sys.stdin.read().split('-auth ')[1].split(' ')[0]"
@prozacgod
prozacgod / EventEmitter.ts
Created March 13, 2018 18:29
Simple EventEmitter for TS
interface EventEmitterHandlers {
[s: string]: IAction1<any>[];
}
class EventEmitter {
private events: EventEmitterHandlers = {};
on(event: string, listener: IAction1<any>) {
!(event in this.events) && this.events[event] = [];
this.events[event].push(listener);