Skip to content

Instantly share code, notes, and snippets.

@Equinox-
Equinox- / main.c
Last active Aug 29, 2015
Conway's Game of Life, written in C/OpenGL. Uses bitmasking for optimization. Build with -lglut -lGL.
View main.c
#include <gl.h>
#include <freeglut.h>
#define LIVE_MASK 0b10000
#define WIDTH 1366
#define HEIGHT 768
short ** front;
short ** back;
@Equinox-
Equinox- / hack-brainspace.js
Created Mar 7, 2014
Grabs cards from brainspace and exports them as CSV.
View hack-brainspace.js
function grabCard() {
if (document.getElementsByClassName("q-title")[0] == undefined) {
return;
}
var data = "";
var prompt = "";
if (document.getElementsByClassName("card-question-prompt")[0] != undefined) {
prompt = "<span>" + document.getElementsByClassName("card-question-prompt")[0].innerHTML.replace(/\"/g,"'").replace(/\n/g,"") + "</span></br>";
}
data += "\"" + prompt + document.getElementsByClassName("q-title")[0].innerHTML.replace(/\"/g,"'").replace(/\n/g,"") + "\",\"" + document.getElementsByClassName("a-title")[0].innerHTML.replace(/\"/g, "'").replace(/\n/g,"") + "\"";
View ll.c
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
typedef int T; // Could be anything
T *firstNode = NULL;
T *lastNode = NULL;
@Equinox-
Equinox- / .habitrc
Last active Aug 29, 2015
habit-rpg-productivity.sh
View .habitrc
YOUR_API_TOKEN=token
YOUR_USER_ID=id
@Equinox-
Equinox- / StringMasks.py
Last active Oct 6, 2015
Added support for back conversion.
View StringMasks.py
#!/usr/bin/python
def stringToInt(name):
name=name[::-1]
val=0
offset=0
for char in name:
val = val + ((ord(char) & 0xff) << offset)
offset = offset + 8
return val
@Equinox-
Equinox- / SMF Newsreel
Created Jul 3, 2012
Fetches all the topics in the given forum.
View SMF Newsreel
<?php
$mysql_host = "";
$mysql_database = "devoxstu_smf391";
$mysql_user = "";
$mysql_password = "";
$forum = 1;
mysql_connect($mysql_host, $mysql_user, $mysql_password)or die("cannot connect");
mysql_select_db($mysql_database)or die("cannot select DB");
//Grab the topics
@Equinox-
Equinox- / JavaConventions2.xml
Created Jul 3, 2012
Westin's java conventions
View JavaConventions2.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="Java Conventions 2" version="12">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
View 1983Defines2012.h
#ifndef __1983DEFINES_H
#define __1983DEFINES_H
#define PRACTICE_BOT 1
#define PRACTICE_OI 0
#define REGULAR_OI 0
#define JOYSTICK_CONTROL 1
//PewPew Start
#define DEADBAND 0.04
View gist:4010095
#!/bin/bash
while :
do
read line
if [ "$line" ]; then
echo $line
fi
done < $1
View injector.js
var fileList = {
"mp_res":"media/icons_context-0.png",
"mp_attack":"media/icons_context-1.png",
"mp_lock":"media/icons_context-2.png",
"mp_star":"media/icons_context-3.png",
"mp_message":"media/icons_context-4.png",
"mp_profile":"media/icons_context-5.png",
"mp_village":"media/icons_context-6.png",
"mp_recruit":"media/icons_context-7.png",
"mp_winadd":"media/icons_context-8.png",