Skip to content

Instantly share code, notes, and snippets.

View JochenHeizmann's full-sized avatar

Jochen Heizmann JochenHeizmann

View GitHub Profile
on his 8th birthday
a magic hammer
becomes the fate
of a new hero
A new 16 Bit adventure
is about to begin
get ready
for 2d platform action
{
"components": [
{
"id": 1,
"layerId": 369,
"visible": true,
"type": "layer",
"path": [
"level completed"
],
@JochenHeizmann
JochenHeizmann / gist:6705117
Created September 25, 2013 19:54
simple script to resize launch images and icons
import Image
import shutil
import os
def resize(sourceImage, newWidth, newHeight, destName):
img = Image.open(sourceImage)
img = img.resize((newWidth, newHeight), Image.ANTIALIAS)
img.save(destName)
print destName, "saved"
do
{
...
} while(0);
FILE *fopenFile( String path,String mode ){
if( !path.StartsWith( "monkey:" ) ){
path=path;
}else if( path.StartsWith( "monkey://data/" ) ){
path=pathForResource( path );
}else if( path.StartsWith( "monkey://internal/" ) ){
NSString *docs=[@"~/Documents" stringByExpandingTildeInPath];
path=String( docs )+"/"+path.Slice(18);
}else{
Class AnimationStep
End
Class AnimationStepLinearMove Extends AnimationStep
End
Class AnimationStepFadeOut Extends AnimationStep
End
Class AnimationStepAction Extends AnimationStep
@JochenHeizmann
JochenHeizmann / gist:3103522
Created July 13, 2012 08:07
Mysql and null values... WAT??
#
# Create Table
#
DROP TABLE IF EXISTS `mytable`;
CREATE TABLE IF NOT EXISTS `mytable` (
`id` int unsigned AUTO_INCREMENT,
`myEnum` enum('foo', 'bar'),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@JochenHeizmann
JochenHeizmann / main.cpp
Created December 7, 2011 15:04
Small example how to use method pointers
#include <iostream>
class MyCallbacks
{
public:
virtual void onResponse(char* response)
{
std::cout << response << std::endl;
}
};
#include "bubblesort.h"
#include <algorithm>
void bubblesort(int *array, int len) {
if (!array || (len < 2))
return;
bool completed = false;
while (!completed) {
@JochenHeizmann
JochenHeizmann / main.cpp
Created November 16, 2010 15:29
Get Prime Factors
/* simple example */
#include <iostream>
#include "prime.h"
int main (int argc, char * const argv[]) {
long number = 33;
Prime::Vec2 factors = Prime::GetPrimeFactors(number);