Skip to content

Instantly share code, notes, and snippets.

View Experiment5X's full-sized avatar

Adam Spindler Experiment5X

View GitHub Profile
@Experiment5X
Experiment5X / Instruction2Bytecode.py
Created April 11, 2014 18:14
Convert an assembly instruction into its bytecode. It uses gas and otool, so this will only work on OS X, but it'd be pretty easy to modify it for linux.
# USAGE INSTRUCTIONS
# It's an interactive shell, where you have the following options...
# - Just type in an assembly instruction in Intel syntax, and it'll spit out the bytecode
# - Change the syntax to AT&T with the att command
# - Change the syntax back to Intel with the intel command
# - Quit with the q command
import os
import sys
import tempfile
import subprocess
@Experiment5X
Experiment5X / EssayScrambler.cpp
Created May 17, 2013 20:34
EssayScrambler is a simple application that will take a text block, the bigger the better, and generate a 'random' text block based off of the input. The application will choose a seed word, and then pick the next word based off of the words that follow the seed word in the input. For example, let's say that the seed word is 'book' and in the in…
#include "EssayScrambler.h"
using namespace std;
EssayScrambler::EssayScrambler(const string &essayText) :
essayText(essayText)
{
parseText();
}
@Experiment5X
Experiment5X / Student.cpp
Created January 5, 2014 22:45
Just a simple project I made to demonstrate some concepts in C++. Here's the video where I teach this project: http://www.youtube.com/watch?v=NIoEVxe-rpk
//
// Student.cpp
// StudentInformationAnalyzer
//
// Created by Adam Spindler on 1/4/14.
// Copyright (c) 2014 Adam Spindler. All rights reserved.
//
#include "Student.h"
@Experiment5X
Experiment5X / mc02_fixer.c
Last active March 27, 2021 23:11
This is a short and simple program that will fix the 3 checksums at the top of some games published by EA for the Xbox 360 console. I know that both Dead Space 1 and 3 have the MC02 header, but I think a lot of other EA games do as well.
#include <stdio.h>
#include <stdlib.h>
typedef unsigned long DWORD;
typedef unsigned char BYTE;
typedef struct
{
DWORD magic; // 0x4D433032, ASCII = "MC02"
DWORD fileLength;
import scala.util.Random
import scala.io.StdIn
object BlackJack extends App {
case class InvalidCardValueException(value: Int) extends Exception(s"Invalid card value of $value")
sealed abstract class Suit
case object Spades extends Suit
case object Clubs extends Suit
@Experiment5X
Experiment5X / vscode.json
Created July 21, 2018 16:51
vscode vim settings
{
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<C-j>"],
"after": ["j", "j", "j", "j"]
},
{
"before": ["<C-k>"],
"after": ["k", "k", "k", "k"]
},
@Experiment5X
Experiment5X / prototype_inheritance.js
Created February 11, 2018 23:41
Javascript prototypes
/**
* Class definition for Monster
*/
function Monster(name) {
this.health = 1000;
this.attack = 100;
this.name = name;
}
Monster.prototype.attack = function(other) {
@Experiment5X
Experiment5X / PyLoko.py
Created January 27, 2018 20:55
PyLoko - basic usage of FourLoko API
import json
import requests
def find_loko(street_address):
request_params = {
'action': 'fourLoko/findProduct',
'address': street_address
}
@Experiment5X
Experiment5X / FootballScores.swift
Created September 16, 2016 01:27
Generate a list of possible methods of scoring in football for a given score.
//
// main.swift
// FootballScores
//
// Created by Adam Spindler on 9/15/16.
// Copyright © 2016 Expetelek. All rights reserved.
//
import Foundation
@Experiment5X
Experiment5X / Tweak.m
Created December 29, 2013 22:32
Change the secondary color theme in the music app on iOS 7 to be the aqua-blue color instead of that ugly pink.
#import <UIKit/UIKit.h>
@interface MAAppDelegate
@property (nonatomic,retain) UIWindow * window;
-(void)applicationDidFinishLaunching:(id)arg1;
@end
%hook MAAppDelegate