Skip to content

Instantly share code, notes, and snippets.

Avatar
🙂
Hello World

Christian Mayer TheFox

🙂
Hello World
View GitHub Profile
@TheFox
TheFox / call_category_loads.c
Last active Aug 29, 2015
Objc call_category_loads
View call_category_loads.c
// Original: http://www.opensource.apple.com/source/objc4/objc4-646/runtime/objc-loadmethod.mm
static BOOL call_category_loads(void){
// ...
int used = loadable_categories_used;
// ...
loadable_categories_used = 0;
// ...
new_categories_added = (loadable_categories_used > 0);
@TheFox
TheFox / lldb_01.txt
Last active Dec 7, 2017
Cracking Hopper App
View lldb_01.txt
:> lldb Hopper.app
lldb:> target create "Hopper.app"
error: unable to find CIE at 0xf1bf1410 for cie_id = 0x0e410000 for entry at 0x00001404.
error: unable to find CIE at 0xfb722890 for cie_id = 0x048e0583 for entry at 0x00002e0f.
Current executable set to 'Hopper.app' (x86_64).
lldb:> run
Process 86127 launched: 'Hopper.app' (x86_64)
Process 86127 exited with status = 45 (0x0000002d)
@TheFox
TheFox / mariadb_install.sh
Last active Jun 19, 2016
Install MariaDB and TokuDB.
View mariadb_install.sh
#!/usr/bin/env bash
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
aptitude update
aptitude install mariadb-server
/etc/init.d/mysql stop
cp /etc/mysql/my.cnf /etc/mysql/my.cnf_ORG
# Change to bind-address = 0.0.0.0
# Change to basedir = /opt/mysql
@TheFox
TheFox / osx_notification_center.m
Last active Jun 19, 2016
Sample code how to send push notification to the Notification Center under Apples OS X 10.8 Mountain Lion.
View osx_notification_center.m
NSUserNotification *note = [[NSUserNotification alloc] init];
[note setTitle:@"TestApp"];
[note setInformativeText:@"Hello World!"];
NSUserNotificationCenter *center = [NSUserNotificationCenter defaultUserNotificationCenter];
[center scheduleNotification: note];
@TheFox
TheFox / exportable.php
Last active Aug 29, 2015
PHP Exportable Class
View exportable.php
<?php
/*
* @author Christian Mayer <http://fox21.at>
* @link http://stackoverflow.com/q/21762276/823644
* @link https://eval.in/163041
* @link https://eval.in/163462
* @link https://eval.in/163909
* @link https://gist.github.com/TheFox/49ff6903da287c30e72f
*/
@TheFox
TheFox / jsframeworks.md
Last active Dec 20, 2016
JavaScript Framework Collection
View jsframeworks.md

JavaScript Framework Collection

A collection of very nice JavaScript frameworks for developer.

Name Description
algorithms.js [S] Classic algorithms and data structures implemented in JavaScript, you know... FOR SCIENCE.
AngularJS [S] HTML enhanced for web apps.
Backbone.js [S] Backbone supplies structure to JavaScript-heavy applications by providing models key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.
beeplay.js [S][H] Write A Song On JavaScript.
@TheFox
TheFox / gc2dm.php
Last active Dec 22, 2015
Google Android Cloud to Device Messaging
View gc2dm.php
<?php
/*
Role of the Third-Party Application Server
https://developers.google.com/android/c2dm/#server
*/
function gc2dmAuth($username, $password = null, $source = 'First-PushApp-1.0', $service = 'ac2dm'){
if($password === null || !$password){
View sieve.c
#include <stdio.h>
#include <malloc.h>
#include <time.h>
#define TEST(f,x) (*(f+(x)/16)&(1<<(((x)%16L)/2)))
#define SET(f,x) *(f+(x)/16)|=1<<(((x)%16L)/2)
int main(int argc, char *argv[]){
unsigned char *feld = NULL, *zzz;
unsigned long teste = 1, max, mom, hits = 1, count, alloc, s = 0, e = 1;
View sibyte.php
<?php
function sibyte($byte){
$e = array('B', 'K', 'M', 'G');
$n = 0;
while($byte >= 1024 && $n < 10){
$n++;
$byte = $byte / 1024;
}
$sbyte = ''.$byte;