This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var Delay; | |
Delay = function(callback, time, args) { | |
var _timer; | |
_timer = setTimeout(function() { | |
if (!args) { | |
callback(); | |
} else { | |
callback(args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sourceFiles = [ | |
]; | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
coffee: { | |
compileJoined: { | |
options: { join: true}, | |
files: {"build/build.js" : sourceFiles} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LogicGates: | |
@staticmethod | |
def AND(A,B): | |
if A == 1 and B == 1: | |
return 1 | |
else: | |
return 0 | |
@staticmethod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*C# Snippets | |
--------------- | |
Open process | |
-------------------------------- | |
*/ | |
using System.Diagnostics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#toriptables.sh | |
# I learned this from https://wiki.torproject.org/noreply/TheOnionRouter/TransparentProxy | |
#Reject all ICMP packets because they have no owner which creates a leak | |
iptables -A OUTPUT -p icmp -j REJECT | |
#All traffic for the user root will go through tor | |
iptables -t nat -A OUTPUT ! -o lo -p tcp -m owner --uid-owner root -m tcp -j REDIRECT --to-ports 9040 | |
iptables -t nat -A OUTPUT ! -o lo -p udp -m owner --uid-owner root -m udp --dport 53 -j REDIRECT --to-ports 53 |