Skip to content

Instantly share code, notes, and snippets.

View mouseroot's full-sized avatar
⚙️
Developing

Mouseroot mouseroot

⚙️
Developing
View GitHub Profile
@mouseroot
mouseroot / utils.js
Last active March 31, 2017 17:55
Javascript canvas game components
//Keymap
var keys = {
up: 38,
down: 40,
left: 37,
right: 39,
key_z: 90,
key_x: 88,
return: 13,
escape: 27,
@mouseroot
mouseroot / str_rot.c
Created March 10, 2017 01:36
Rotate a String in C
char *rotateString(char *str, int count) {
size_t len = strlen(str);
int counter;
for(counter=0;counter < len;counter++) {
int value = str[counter];
if((char)value != ' ') {
value = value + count;
str[counter] = value;
}
}
//Very simple jump on 9 to next op
/*
var program = ["0","0","0","1337","9","4"];
var pc = 0;
for(var i=0;i < program.length;i++) {
switch(program[i])
{
case "0":
//Skip
@mouseroot
mouseroot / Delay-compiled.js
Last active August 29, 2015 14:19
Delay.js - Simple wrapper around setTimout to cleanup the handle refs
(function() {
var Delay;
Delay = function(callback, time, args) {
var _timer;
_timer = setTimeout(function() {
if (!args) {
callback();
} else {
callback(args);
@mouseroot
mouseroot / Gruntfile.js
Last active August 29, 2015 14:17
Coffeescript grunt file + index test page
var sourceFiles = [
];
module.exports = function(grunt) {
grunt.initConfig({
coffee: {
compileJoined: {
options: { join: true},
files: {"build/build.js" : sourceFiles}
@mouseroot
mouseroot / phaser_notes.txt
Last active August 29, 2015 14:15
Phaser.js Notes
Phaser.js Notes
By: Mouseroot
Phaser init
-----------
var game = new Phaser.Game(width, height, Render_mode, canvas_id, gamestate_object, transparent_canvas, anti-alias, physics);
render_modes
Phaser.CANVAS - Force canvas
Phaser.WEBGL - Force webgl
@mouseroot
mouseroot / Gates.py
Created November 7, 2014 19:35
Gates Class With Examples (HalfAdder/FullAdder)
class LogicGates:
@staticmethod
def AND(A,B):
if A == 1 and B == 1:
return 1
else:
return 0
@staticmethod
@mouseroot
mouseroot / snips.cs
Created November 7, 2014 19:32
C# Snippets
/*C# Snippets
---------------
Open process
--------------------------------
*/
using System.Diagnostics
https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py
@mouseroot
mouseroot / parsePost.cs
Created April 24, 2014 00:01
C# POSTDATA Parser
Dictionary<string, string> postParams = new Dictionary<string, string>();
postParams.Clear();
string[] rawParams = rawData.Split('&');
foreach (string param in rawParams)
{
string[] kvPair = param.Split('=');
string key = kvPair[0];
string value = HttpUtility.UrlDecode(kvPair[1]);
postParams.Add(key, value);
}