Skip to content

Instantly share code, notes, and snippets.

View erodozer's full-sized avatar
🚧
I may be slow to respond between 8am-8pm EST M-F

Nicholas Hydock / ero erodozer

🚧
I may be slow to respond between 8am-8pm EST M-F
View GitHub Profile
@erodozer
erodozer / xkcd.user.js
Created February 11, 2014 22:53
Make reading the news more fun! http://xkcd.com/1288/
// ==UserScript==
// @name XKCD Subtitutions
// @namespace xkcd
// @description Make reading the new more fun! http://xkcd.com/1288/
// @include http://news.yahoo.com/*
// @include http://news.google.com/*
// @include http://*.cnn.com/*
// @include http://*.nbc.com/*
// @include http://arstechnica.com/*
// @version 1
@erodozer
erodozer / dungeon.py
Last active March 11, 2016 17:19
Create daily dungeons for StoryMode
import sqlite3, atexit, random
import schedule
from flask import Flask, request, session, g, jsonify
from datetime import datetime
from contextlib import closing
# configuration
DATABASE = './sm_daily.db'
DEBUG = True
SECRET_KEY = 'development key'
@erodozer
erodozer / ConversionUtility.java
Created December 2, 2015 20:30
String to Boolean
public class ConversionUtility {
/**
* Set of appropriate types of Strings that we may convert booleans into or parse from
*/
public static enum BooleanConversion {
YN("Y", "N"), YesNo("Yes", "No"), TrueFalse("True", "False");
public final String True;
public final String False;
@erodozer
erodozer / LibGDXController.md
Last active December 29, 2015 19:43
Game Controller Abstraction for LibGDX

Game Controller Abstraction for LibGDX

@erodozer
erodozer / fader.glsl
Last active March 9, 2016 18:17
Simple fragment shader that allows you to use any RGB image as a fading mask
const float RATE = 5.0;
/**
* Converts RGB value from our texture channel into an HSV value.
* By using the V we can perform a transition using any color image
*/
vec3 rgb2hsv(vec3 c)
{
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
@erodozer
erodozer / Object Flatten
Created March 9, 2016 18:00 — forked from penguinboy/Object Flatten
Flatten javascript objects into a single-depth object
/**
* Flattens a json object into a single-dimensional representation
* @param: stripPrefix: boolean
* by default, subobjects will have their property name prefixed to the flattened property name.
* This is done to prevent overwriting of properties with the same name. If this is a non-issue
* for your data type, then feel free to set this to true
* @return: a single dimensional copy of the original object
*/
Object.defineProperty(Object.prototype, 'flatten', {
value: function(stripPrefix) {
@erodozer
erodozer / System Info
Created May 4, 2016 03:35
System info as fetched by steam
Computer Information:
Manufacturer: BIOSTAR Group
Model: A870U3
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Family: 0x10
CPU Model: 0x4
@erodozer
erodozer / rip_iso.sh
Created June 19, 2016 02:44
Stupid simple bash script for properly ripping PS2 dvds and naming them by their SLUS
#!/bin/sh
device='/dev/sr0'
mount=$(mount | grep $device | cut -d " " -f 3)
DVD_NAME=$(find $mount -name "SLUS_*" | grep -o '[^/]*$')
blockcount=$(isoinfo -d -i $device | grep "^Volume size is:" | cut -d " " -f 4)
blocksize=$(isoinfo -d -i $device | grep "^Logical block size is:" | cut -d " " -f 5)
dd if=$device bs=$blocksize count=$blockcount of=$DVD_NAME.iso
@erodozer
erodozer / 3ch.txt
Last active January 18, 2020 18:19
3ch Golf Language Specification
3ch Language Specification
***keywords***
always lower case
var - declare variable
val - declare constant
cls - class
slf - self (this)
sup - super
@erodozer
erodozer / EventPool.java
Last active October 25, 2016 15:04
Event pool extending libgdx's reflection pool
public class EventPool extends SharedInheritenceReflectionPool<Event> {
public EventPool () {
this(16, Integer.MAX_VALUE);
}
public EventPool (int initialCapacity) {
this(initialCapacity, Integer.MAX_VALUE);
}