Skip to content

Instantly share code, notes, and snippets.

#import "CCSprite.h"
@interface SoftBubble : CCSprite
@end
--- CCDevice.mm (revision 6)
+++ CCDevice.mm (working copy)
@@ -102,11 +102,12 @@
- (void)accelerometer:(CMAccelerometerData *)accelerometerData
{
- _acceleration->x = accelerometerData.acceleration.x;
- _acceleration->y = accelerometerData.acceleration.y;
- _acceleration->z = accelerometerData.acceleration.z;
- _acceleration->timestamp = accelerometerData.timestamp;
@idimiter
idimiter / clu_explorer.c
Last active August 29, 2015 14:13
Reversing tools for Road To El Dorado & In Cold Blood game file formats
#include <stdio.h>
#include <stdlib.h>
#define MAX_FILENAME 256
typedef struct {
char magic[4]; // CLU
int version; // 2
int header_size;
int count;
@idimiter
idimiter / sniff.c
Last active August 23, 2019 16:55
WiFi handshake sniffer
/**
* WiFi handshake sniffer v 0.5b
*
* Author: Dimitar T. Dimitrov
* Sofia, Bulgaria 2016
* Under MIT License
*
* gcc sniff.c -lpcap -o sniff
*
*/
@idimiter
idimiter / unet_udp.c
Last active May 26, 2016 18:18
Unity Transport UDP Layer basic echo server
//
// unet_udp.c
// Unity Transport UDP Layer basic echo server
//
// Created by Dimitar Dimitrov on 12/27/15.
// Copyright © 2015 Dimitar Dimitrov. All rights reserved.
//
#include <stdlib.h>
#include <stdio.h>
@idimiter
idimiter / bash_fun.c
Created June 15, 2016 07:17
Having some fun with the bash escape sequences
/*
* bash_fun.c
*
* Dimitar T. Dimitrov
* 15.06.2016
*
*/
#include <sys/ioctl.h>
#include <unistd.h>
#include <stdio.h>
#ifndef TOTO_EDITIONS_DIMITAR_TDIMITROV
#define TOTO_EDITIONS_DIMITAR_TDIMITROV 1
#include <vector>
struct Edition {
float year;
float index;
int numbers[6];
@idimiter
idimiter / 3dascii.c
Last active May 8, 2017 16:57
basic 3D object draw in terminal
// Dimitar T. Dimitrov 2017
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
const int width = 64;
const int height = 64;
char screen[width * height];
@idimiter
idimiter / public_key.c
Last active May 29, 2017 19:35
Basic Public/Private key example in C
#include <stdio.h>
#include <string.h>
const int publicKey = 42;
const int privateKey = 256 - publicKey;
const int m = publicKey + privateKey;
void scramble(char* s, int key) {
for (size_t i = 0; i < strlen(s);i++)
s[i] = (s[i] + key) % m;
#include <stdio.h>
#include <math.h>
float kyp(float t, float kypLength) {
return fabs( sin(t * 9.45) * ((t > 0.33 && t < 0.66)? kypLength : 1) );
}
float easeIn(float t, float strength) {
return pow(t, strength);
}