Skip to content

Instantly share code, notes, and snippets.

View annidy's full-sized avatar
💭
I may be slow to respond.

fengxing annidy

💭
I may be slow to respond.
View GitHub Profile
// interface
struct object {
object * create();
void release();
int getState();
};
// implementation
@nazgob
nazgob / ctags.setup
Created January 6, 2012 13:44
ctags setup on mac
# you have ctags but it does not work...
$ ctags -R --exclude=.git --exclude=log *
ctags: illegal option -- R
usage: ctags [-BFadtuwvx] [-f tagsfile] file ...
#you need to get new ctags, i recommend homebrew but anything will work
$ brew install ctags
#alias ctags if you used homebrew
$ alias ctags="`brew --prefix`/bin/ctags"
@sh1n0b1
sh1n0b1 / BinaryCookieReader.py
Created August 28, 2015 20:46
BinaryCookieReader
#*******************************************************************************#
# BinaryCookieReader: Written By Satishb3 (http://www.securitylearn.net) #
# #
# For any bug fixes contact me: satishb3@securitylearn.net #
# #
# Usage: Python BinaryCookieReader.py Cookie.Binarycookies-FilePath #
# #
# Safari browser and iOS applications store the persistent cookies in a binary #
# file names Cookies.binarycookies.BinaryCookieReader is used to dump all the #
# cookies from the binary Cookies.binarycookies file. #
@fousa
fousa / FairPlayer.swift
Last active June 1, 2023 12:28
Integrate HLS with FairPlay.
class FairPlayer: AVPlayer {
private let queue = DispatchQueue(label: "com.icapps.fairplay.queue")
func play(asset: AVURLAsset) {
// Set the resource loader delegate to this class. The `resourceLoader`'s delegate will be
// triggered when FairPlay handling is required.
asset.resourceLoader.setDelegate(self, queue: queue)
// Load the asset in the player.
@swillits
swillits / NSDICT.m
Last active May 2, 2023 13:48
Obj-C NSDictionary Literal-like syntax allowing nil values
/*
---------------------------------------------------------------------------------------
Obj-C Literal Dictionary Syntax - Multiple reasons for allowing nil values
Radar 19747372
---------------------------------------------------------------------------------------
The obj-c literal syntax for dictionaries does not allow nils.
@{key : nil}; // Exception (and compiler error)
@niw
niw / how_to_extract_dylib_from_shared_cache.md
Last active January 25, 2023 15:39
How to extract dylib from shared cache

How to extract dylib from shared cache

To understand iOS behaviors, sometimes it’s important to disassemble iOS framework binaries.

Since recent iOS firmware, known as .ipsw file, contains non-encrypted root image, it’s easy to access these binaries. However, each framework binaries, dylib files, are placed in a shared cache file.

Thus, before disassembling it, we need to extract the one from the cache.

@bnickel
bnickel / RestorationDefender.swift
Last active January 12, 2023 09:47
A few friendly methods to help you detect state restoration problems in your non-storyboard apps.
// USAGE:
// Call RestorationDefender.printViewControllerClassesThatAreProbablyNotRestorable() to print a list of view controllers that will probably not return from state restoration.
// Call RestorationDefender.crashWhenViewControllersDoNotImplementStateRestoration() to crash your app when a view controller appears without setting restorationIdentifier and restorationClass.
// Call RestorationDefender.shoutWhenViewControllersDoNotImplementStateRestoration() to print a big message when a view controller appears without setting restorationIdentifier and restorationClass.
import Foundation
private func objc_getClassList() -> [AnyClass] {
let expectedClassCount = objc_getClassList(nil, 0)
var allClasses = UnsafeMutablePointer<AnyClass?>.alloc(Int(expectedClassCount))
@roxlu
roxlu / YUV420PGrabber.cpp
Created July 2, 2013 08:36
OpenGL RGB > YUV420P shader/class (doesn't do much more. implementation/usage is up to you)
#include <assert.h>
#include <roxlu/core/Utils.h>
#include <roxlu/core/Log.h>
#include "YUV420PGrabber.h"
YUV420PGrabber::YUV420PGrabber()
:y_prog(0)
,y_vert(0)
,y_frag(0)
,uv_prog(0)
@rcapraro
rcapraro / README.md
Last active April 1, 2022 13:50 — forked from steve-jansen/README.md
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/rcapraro/a9ebd4db4d1bfe45b02f89aabd6595a3/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
@anhphamt
anhphamt / install_supervisord_centos.md
Last active February 22, 2022 04:00 — forked from fadhlirahim/installing_supervisor_macosx.md
Setting up supervisord in Mac OSX or CENTOS