Skip to content

Instantly share code, notes, and snippets.

View ror3d's full-sized avatar

Roc ror3d

View GitHub Profile
@ror3d
ror3d / README.md
Last active April 16, 2023 16:07
Tampermonkey userscript to enable subtitles by default in dropout.tv
#include <vector>
template<class T, unsigned buffer_size=500>
class circular_queue
{
public:
unsigned front = 0;
unsigned back = 0;
unsigned count = 0;
std::vector<T> items;
@ror3d
ror3d / gradient_map_generator.rb
Last active August 29, 2015 14:19
Generators for the jigsaw code puzzle challenge.
# Creates a grid of numbers, where each number is the minimum L2 (Manhattan) distance to
# the nearest zero in the grid.
# Called as
# $ ruby image_generator.rb _width_ [_height_ [_num_zeroes_ [_max_num_]]]
# width - the number of columns of the output
# height - defaults to width
# num_zeroes - maximum number of zeroes in the output
# max_num defaults to 9
require 'optparse'
@ror3d
ror3d / d10.rb
Created August 4, 2014 22:38
Calculates the probability rates for a Nd10 throw using a World of Darkness system for successes/failures
min_to_succ = 6
puts 'How many d10 should be rolled?'
n = gets.chomp.to_i
comb = (1..10).to_a.map { |x| [x] }
for i in 2..n
comb2 = []
for j in 1..10
@ror3d
ror3d / gist:7865655
Created December 9, 2013 00:31
Sample code for Andreu's project. It should get the data inside the <text> tag of a simple xml file and separate it into words.
void readFile()
{
ifstream file;
char c;
enum ReadState {
StartFile, EndFile, Tag, Text
};
ReadState state = StartFile;
ReadState lastState = StartFile;
@ror3d
ror3d / split.cpp
Created September 27, 2012 10:04 — forked from anonymous/split.cpp
Argument Splitter
char ** split(const string & str, int arguments){
char ** argv;
argv = new char * [arguments];
uint index = 0;
int offset = 0;
int argcount = 0;
do{
index = 0;
while (str[index + offset] != ' ' && index + offset < str.length()){
index ++;