Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@0xc010d
0xc010d / readability.js
Created November 7, 2011 19:18 — forked from jakedahn/readability.js
Readability.js
/*jslint undef: true, nomen: true, eqeqeq: true, plusplus: true, newcap: true, immed: true, browser: true, devel: true, passfail: false */
/*global window: false, readConvertLinksToFootnotes: false, readStyle: false, readSize: false, readMargin: false, Typekit: false, ActiveXObject: false */
var dbg = (typeof console !== 'undefined') ? function(s) {
console.log("Readability: " + s);
} : function() {};
/*
* Readability. An Arc90 Lab Experiment.
* Website: http://lab.arc90.com/experiments/readability
@0xc010d
0xc010d / gist:1779129
Created February 9, 2012 10:30 — forked from xslim/gist:1779062
Print all methods from class
#include <objc/runtime.h>
#include <objc/message.h>
+ (void)printClassMethods:(Class)class {
NSLog(@"Methods in %@", NSStringFromClass(class));
unsigned int out_count = 0;
Method *class_methods = class_copyMethodList(class, &out_count);
for (int i = 0; i < out_count; i++) {
Method m = class_methods[i];
NSLog(@"\t%@", NSStringFromSelector(method_getDescription(m)->name));
@0xc010d
0xc010d / TVRemote.m
Created March 15, 2012 15:41 — forked from xslim/TVRemote.m
TVRemote
@interface TVRemote : NSObject
@property (nonatomic, retain) TVRemoteAbstract *currentRemote;
- (void)createSocketRemote;
@end
@implementation TVRemote
- (void)createSocketRemote {
self.currentRemote = [[TVRemoteSocket alloc] init];
}
@0xc010d
0xc010d / recodesign.sh
Created June 20, 2012 15:31 — forked from xslim/recodesign.sh
Recodesign ipa
#!/bin/sh
SAVEDIR=`pwd`
WORKDIR=/tmp/ipa_$RANDOM$RANDOM
WORKIPA=/tmp/ipa_$RANDOM$RANDOM.ipa
echo unpacking $1
mkdir -p $WORKDIR
unzip "$1" -d $WORKDIR > /dev/null || exit
cd $WORKDIR
@0xc010d
0xc010d / ADVUserInterfaceIdiom.h
Created September 10, 2012 09:13 — forked from advantis/ADVUserInterfaceIdiom.h
Easy user interface idiom detection
//
// Copyright © 2012 Yuri Kotov
//
extern BOOL ADVUserInterfaceIdiomIsPhone;
#include <stdio.h>
#include <dlfcn.h>
#include <execinfo.h>
typedef void (*cxa_throw_type)(void *, void *, void (*) (void *));
cxa_throw_type orig_cxa_throw = 0;
void load_orig_throw_code()
{
orig_cxa_throw = (cxa_throw_type) dlsym(RTLD_NEXT, "__cxa_throw");
# Basic Strongswan ikev2 server setup
* paltform: atlantic.net ubuntu 14.04 x64
* the commands below are run with root account
## Strongswan
```
apt-get install strongswan
apt-get install iptables iptables-persistent
```
@0xc010d
0xc010d / ReCodeSign
Created November 14, 2011 22:38
Codesign an iOS app, with a different distribution certificate and mobileprovisioning file.
- Copy the delivered ipa into a directory to work in.
- export PlistBuddy="/usr/libexec/PlistBuddy" to get the PlistBuddy tool to your shell. If it is not added, all references to PlistBuddy
will need to be written as the full path.
- Take the delivered App.ipa and unzip it using the unzip command. This should produce a Payload directory containing the app and its
resources.
- Enter the command "codesign -d --entitlements :enterprise.plist Payload/PathToApp.app/" This pulls the entitlements out of the app, and
prints them to a plist, without a leading "blob" of data. Pay particular attention to the colon before the enterprise.plist file name.