Skip to content

Instantly share code, notes, and snippets.

View catlan's full-sized avatar

Christopher Atlan catlan

View GitHub Profile
@catlan
catlan / openssl-build.sh
Created August 8, 2020 10:55 — forked from felix-schwarz/openssl-build.sh
Updated script that builds OpenSSL for OS X, iOS and tvOS. Bitcode enabled for iOS, tvOS. Updated to build for tvOS, use the latest SDKs, skip installing man pages (to save time), download the OpenSSL source over HTTPS, patch OpenSSL for tvOS to not use fork(). Currently requires Xcode7.1b or later (for the tvOS SDK).
#!/bin/bash
# This script downloads and builds the iOS, tvOS and Mac openSSL libraries with Bitcode enabled
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# https://gist.github.com/foozmeat/5154962
# Peter Steinberger, PSPDFKit GmbH, @steipete.
# Felix Schwarz, IOSPIRIT GmbH, @felix_schwarz.
@catlan
catlan / Document.m
Last active August 7, 2019 21:31
Pages.app like moveToURL:completionHandler: impl. NSIsRelatedItemType key in Info.plist is required
- (void)moveToURL:(NSURL *)url completionHandler:(void (^ __nullable)(NSError * __nullable))completionHandler
{
NSError *error = nil;
NSURL *adjustedURL = nil;
if (![[url pathExtension] isEqualToString:@"testextension"]) {
adjustedURL = [url URLByAppendingPathExtension:@"testextension"];
}
@catlan
catlan / README.md
Last active February 27, 2023 16:19 — forked from zrxq/.lldbinit
Execute lldb command and open its output in Kaleidoscope diff

Diff output of two lldb commands

Setup

  1. Copy the contents of the last snippet (lldbinit) from the gist page, and paste into your .lldbinit file. This makes the ksdiff macro known inside lldb.
  2. Put file ksdiff.py in ~/.lldb/
  3. sudo pip install temp
  4. Restart Xcode debug session

Example

(lldb) ksdiff ;

@catlan
catlan / 01its-serverData.json
Last active March 23, 2020 23:02
https://itunes.apple.com/at/app/instagram/id389801252 X-Apple-Store-Front: 143445-2,32 apple-originating-system: MZStore
{
"storePlatformData": {
"product-dv-product": {
"results": {
"389801252": {
"artwork": [
{
"width": 170,
"height": 170,
"url": "https://is2-ssl.mzstatic.com/image/thumb/Purple118/v4/de/b9/5b/deb95b99-0b17-7713-9a0e-99344ebf4e55/Prod-1x_U007emarketing-85-220-0-5.png/170x170bb.png"
@catlan
catlan / README.md
Last active December 18, 2015 00:22
Script to update the style in fastspring by @lukele

Install

sudo easy_install pip
sudo pip install requests
sudo pip install pyquery

Settings

@interface SomeViewController ()
// Declare some collection properties to hold the various updates we might get from the NSFetchedResultsControllerDelegate
@property (nonatomic, strong) NSMutableIndexSet *deletedSectionIndexes;
@property (nonatomic, strong) NSMutableIndexSet *insertedSectionIndexes;
@property (nonatomic, strong) NSMutableArray *deletedRowIndexPaths;
@property (nonatomic, strong) NSMutableArray *insertedRowIndexPaths;
@property (nonatomic, strong) NSMutableArray *updatedRowIndexPaths;
@end
Pacific Standard Time
file: 50 00 61 00 63 00 69 00 66 00 69 00 63 00 20 00 53 00 74 00 61 00 6E 00 64 00 61 00 72 00 64 00 20 00 54 00 69 00 6D 00 65 00
mem sometimes: 61 63 69 66 69 63 20 53 74 61 6e 64 61 72 64 20 54 69 6d 65 6572 6f67 6972 6e61 6d2f 6e6f 6874 614e 656d 2f73 0
@catlan
catlan / gist:3946586
Created October 24, 2012 15:02
Little Snitch and his Friends
if ([[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"com.metakine.handsoff"])
{
NSAlert *alert = [NSAlert alertWithMessageText:@"Letter Opener found \"Hands Off!\" application"
defaultButton:@"OK"
alternateButton:nil
otherButton:nil
informativeTextWithFormat:@"Make sure connections to www.creativeinaustria.com are allowed in \"Hands Off!\""];
[alert setIcon:[NSImage imageNamed:OMiCIcon]];
[alert runModal];
}
# You need #import <objc/runtime.h>
#ifdef DEBUG
void pspdf_swizzle(Class c, SEL orig, SEL new) {
Method origMethod = class_getInstanceMethod(c, orig);
Method newMethod = class_getInstanceMethod(c, new);
if(class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) {
class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
}else {
@catlan
catlan / revert-iphone-optimizations.pl
Created April 18, 2010 16:35
revert iphone png optimizations
#!/usr/bin/perl
use warnings;
use strict;
use File::Find;
use File::Spec::Functions qw(rel2abs);
use File::Basename;
use Cwd;
my $dir = dirname(rel2abs($0));