Skip to content

Instantly share code, notes, and snippets.

View JohnWong's full-sized avatar
🎯
Working hard

John Wong JohnWong

🎯
Working hard
View GitHub Profile
#!/jb/bin/bash
CYCRIPT_PORT=1337
function help {
echo "Syntax: $0 [-p PID | -P appname] [-l /path/to/yourdylib | -L feature]"
echo
echo For example:
echo " $0 -P Reddit.app -l /path/to/evil.dylib # Injects evil.dylib into the Reddit app"
echo " or"
@allanweir
allanweir / STAnimationView.swift
Last active July 8, 2017 14:22
Lottie subclass for partial and reverse playback on iOS
//
// STAnimationView.swift
// Allan Weir
//
// Created by Allan Weir on 06/02/2017.
// Copyright © 2017 Allan Weir. All rights reserved.
// http://www.studiousdesigns.com
//
import UIKit
@wh1t3p1g
wh1t3p1g / ctf古典密码集合
Last active March 23, 2025 16:52
古典密码集合
下述密码均摘自互联网
【字母表顺序】-数字 
  加密的时候,经常要把A~Z这26个字母转换成数字,最常见的一种方法就是取字母表中的数字序号。A代表1,B代表2,C代表3... 
  字母 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 
  数字 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 
@p0we7
p0we7 / himawari8.rb
Last active December 15, 2015 11:23
Get hight quality image via himawari8 by @pepsin
require 'net/http'
require "cairo"
def get_url time, x, y
str = "http://himawari8-dl.nict.go.jp/himawari8/img/D531106/20d/550/#{time}00_#{x}_#{y}.png"
end
def merge time
puts "Start image process"
w = 20
@jspahrsummers
jspahrsummers / main.m
Created November 24, 2015 16:11
[NSThread isMainThread] is probably not what you want!
#import <Foundation/Foundation.h>
int main (int argc, const char **argv) {
@autoreleasepool {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_sync(dispatch_get_main_queue(), ^{
NSLog(@"is main thread? %i", (int)[NSThread isMainThread]);
});
});
@sodabiscuit
sodabiscuit / xcode_plugin_auto_compatible.sh
Last active May 4, 2016 05:21
Xcode Plugin AutoCompatible
#!/bin/bash
XCODE_UUID=$(defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID)
PLUGIN_PATH="$HOME/Library/Application Support/Developer/Shared/Xcode/Plug-ins"
for plugin in "$PLUGIN_PATH"/*.xcplugin ; do
defaults write "${plugin}"/Contents/Info DVTPlugInCompatibilityUUIDs -array-add $XCODE_UUID
done
@implementation FBStoryView
{
FBHeaderView *_headerView;
FBMessageView *_messageView;
FBAttachmentView *_attachmentView;
FBLikeBarView *_likeBarView;
}
- (instancetype)initWithFrame:(CGRect)frame
{
import lldb
import re
import shlex
# This script allows Xcode to selectively ignore Obj-C exceptions
# based on any selector on the NSException instance
def getRegister(target):
if target.triple.startswith('x86_64'):
return "rdi"
@aras-p
aras-p / preprocessor_fun.h
Last active May 16, 2025 11:21
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@steipete
steipete / PSPDFUIKitMainThreadGuard.m
Last active May 27, 2024 12:11
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>