Skip to content

Instantly share code, notes, and snippets.

View adamveld12's full-sized avatar
🏠
Working from home

Adam Veldhousen adamveld12

🏠
Working from home
View GitHub Profile
@adamveld12
adamveld12 / MersennePrimeRandom.cs
Last active March 15, 2022 01:27
Mersenne prime random number generator in C#
/// <summary>
/// Implementation of Mersenne Twister random number generator
/// </summary>
public class MersennePrimeRandom
{
private readonly uint[] _matrix = new uint[624];
private int _index = 0;
public MersennePrimeRandom() : this((uint)(0xFFFFFFFF & DateTime.Now.Ticks)) { }
@adamveld12
adamveld12 / DynamicDayNightSystem.uc
Created November 29, 2014 02:38
Day/Night cycle UE3 unrealscript file. Everything is self contained and works out of the box.
/******************************************************************************
* DynamicDayNightSystem.uc
* Copyright 2011 Adam Veldhousen
*
* Defines a basic real time animated lightsource with fog, completely customizable. You supply your own material
* and sky box static mesh and this class takes care of the rest.
*
******************************************************************************/
class DynamicDayNightSystem extends Actor hidecategories(Object, Debug, Advanced, Physics, Collision, Attachment)
ClassGroup(Lights, Systems)
@adamveld12
adamveld12 / PerlinSimplexNoise.cs
Created December 3, 2014 21:18
simplex perlin noise implementation I used in a block engine platforming game that I made in college
public static class PerlinSimplexNoise
{
#region Initizalize grad3
private static int[][] grad3 = {
new int[]{1,1,0},
new int[]{-1,1,0},
new int[]{1,-1,0},
new int[]{-1,-1,0},
new int[]{1,0,1},
@adamveld12
adamveld12 / readme.markdown
Last active August 29, 2015 14:11 — forked from jonah-williams/readme.markdown
The Readme Template

Catchy Project Name

Description: What does this project do and what audience is it intended for?

I like to add my CI badges here, since it helps everyone to easily see the health of the project

Project Setup

How do I, as a developer, start working on the project?

@adamveld12
adamveld12 / LICENSE.txt
Created December 10, 2014 17:51
MIT License template
The MIT License (MIT)
Copyright (c) <year> Adam Veldhousen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@adamveld12
adamveld12 / 1GAM.md
Last active August 29, 2015 14:11
Ideas for 1 game a month (1GAM)

1 Game A Month (1GAM) 2015

Try to incorporate the following techniques in some of the titles. Every game doesn't have to have all or any of these, but here are some side objectives.

  • Procedural Generation
  • Entity Component System
  • Audio/Rhythm gameplay
@adamveld12
adamveld12 / csv.js
Created December 24, 2014 21:54
Reads CSV format files and outputs them as a .json file with an array of row objects. Each property of the row object matches the column headers.
var fs = require('fs'),
inputFile = process.argv[2],
outputFile = process.argv[3],
askingForHelp = process.argv[2] === "help" || process.argv[2] === "h";
if(askingForHelp){
console.log("Parses a CSV into json");
console.log('e.g node csv.js <inputFile> <outputFile>');
}
else if(!inputFile || !outputFile){

Tinder API documentation

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

Note: this was written in April/May 2014 and the API may have changed since

API Details

@adamveld12
adamveld12 / IniFile.cs
Created December 27, 2014 18:30
INI File DOM - Loads, creates and modifies INI files. Useful for games
/// <summary>
/// An Ini file implementation/DOM
/// </summary>
public class IniFile
{
private readonly IDictionary<string, Section> _sections = new Dictionary<string, Section>();
/// <summary>
/// The key for a section of the INI file that isn't in a section block
/// </summary>
#!/bin/sh
# OPTIONAL FLAGS:
#
# -geoip true
# this will install maxmind geoip and auto update crontab file
#
# -cloudwatch true
# this will install aws cloud watch metrics and send them to aws dashboard
#