Skip to content

Instantly share code, notes, and snippets.

View ericbroska's full-sized avatar

Eric Broska ericbroska

View GitHub Profile
#include <stdio.h>
#define NEXT goto **ip++
int main()
{
int fact = 6, fact_b0 = 16;
void* program[] = {
&&push, (void*)5, &&call, (void*)fact, &&printi, &&end,
&&beq0, (void*)fact_b0, &&dup, &&push, (void*)1, &&sub, &&call, (void*)fact, &&mult, &&ret,
&&pop, &&push, (void*)1, &&ret };
@letiemble
letiemble / receigen_dump.sh
Last active October 6, 2015 09:38
Receigen dumper shell script to help diagnose receipt validation issues
#!/bin/bash
#
# Copyright (c) 2011-2014 Laurent Etiemble (laurent dot etiemble at gmail dot com)
#
# This script is provided as-is without any warranties. Use it at your own risks.
#
# Get parameter
APP_BUNDLE=$1
@cleure
cleure / gist:2501036
Created April 26, 2012 17:09
Primitive try/catch Exception Handling in C
#include <stdio.h>
#include <setjmp.h>
struct Exception {
jmp_buf jb;
int code;
};
/* Definitely not thread-safe... But we don't care :-) */
struct Exception *cur_ex_ptr = NULL;
@0xced
0xced / NSRunningApplication+DockIcon.h
Created March 15, 2012 16:00
NSRunningApplication category to dynamically show and hide any running application icon in the Dock
//
// Created by Cédric Luthi on 2011-05-03
// Copyright 2011-2012 Cédric Luthi. All rights reserved.
//
#import <AppKit/AppKit.h>
@interface NSRunningApplication (DockIcon)
- (BOOL) setDockIconHidden_xcd:(BOOL)dockIconHidden;