Skip to content

Instantly share code, notes, and snippets.

@tony0x59
tony0x59 / uncrustify.cfg
Created July 3, 2015 10:33
uncrustify.cfg
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.2 (140)
#
# Alignment
# ---------
## Alignment
@tony0x59
tony0x59 / PSPDFUIKitMainThreadGuard.m
Last active October 28, 2019 11:15 — forked from steipete/PSPDFUIKitMainThreadGuard.m
iOS,在DEBUG模式自动探测非主线程视图更新操作,将.m加入项目即可生效。
// 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.
#ifdef DEBUG //only use this in debug builds
#import <objc/runtime.h>
#import <objc/message.h>
@tony0x59
tony0x59 / makeWNDR3800_BB_rc2
Last active January 18, 2017 09:28
my wndr3800 openwrt custom make config
#!/bin/bash
mpfl="WNDR3700"
mpkg=""
# luci
mpkg+="luci luci-ssl luci-i18n-chinese"
# dnsmasq-full for FreeRouterV2
mpkg+=" -dnsmasq dnsmasq-full"
@tony0x59
tony0x59 / FLVTemplateEx.bt
Last active August 29, 2015 14:03
FLV File format parser for 010 Editor
//-----------------------------------
//--- 010 Editor v5.0.1 Binary Template
//
// File: FLVTemplateEx.bt
// Author: lafei(indep@263.net), Tony(HanningKong@gmail.com)
// Revision: 3.0
// Purpose: Defines a template for
// parsing FLV files.
// Tony Update: base lafie version, add a lot of data deail info:
// 1. Metadata detail info
/*
* System Versioning Preprocessor Macros
*/
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_hd_intermediate_swift.mov
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_hd_advanced_graphics_and_animation_performance.mov
http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_hd.mov
http://devstreaming.apple.com/videos/wwdc/2014/236xxwk3fv82sx2/236/236_hd_building_interruptible_and_responsive_interactions.mov
http://devstreaming.apple.com/videos/wwdc/2014/306xxjtg7uz13v0/306/306_hd_javascript_for_automation.mov
http://devstreaming.apple.com/videos/wwdc/2014/404xxdxsstkaqjb/404/404_hd_advanced_swift.mov
http://devstreaming.apple.com/videos/wwdc/2014/701xx8n8ca3aq4j/701/701_hd_designing_accessories_for_ios_and_os_x.mov
http://devstreaming.apple.com/videos/wwdc/2014/224xxxlsvigdoc0/224/224_hd_core_os_ios_application_architectural_patterns.mov
http://devstreaming.apple.com/videos/wwdc/2014/717xxux5eg6f9v4/717/717_hd_kids_and_apps.mov
http://devstreaming.apple.com/videos/wwdc/2014/716xx8q4shlqcp8/716/
@tony0x59
tony0x59 / 0_reuse_code.js
Created May 31, 2014 10:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tony0x59
tony0x59 / UITableView+CellForPressedButton.m
Created April 28, 2014 07:54
用于替代DirtyHack([[sender superview] superview])
#import "UITableView+CellForPressedButton.h"
@implementation UITableView (CellForPressedButton)
- (NSIndexPath*)indexPathForPressedButton:(UIView*)button
{
CGPoint buttonPosition = [button convertPoint:CGPointZero toView:self];
NSIndexPath *indexPath = [self indexPathForRowAtPoint:buttonPosition];
return indexPath;
}
@tony0x59
tony0x59 / nginx.conf
Created April 23, 2014 09:53
Nginx RTMP Configure
#user nobody;
worker_processes 1;
error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@tony0x59
tony0x59 / NSObject+SafeCategory.m
Last active July 19, 2017 23:15
使用Method swizzling方法修改常用函数行为
//
// NSObject+SafeCategory.m
//
// Created by Tony on 14-4-3.
// Copyright (c) 2014年 Tony. All rights reserved.
//
#import "NSObject+SafeCategory.h"
#import <JRSwizzle/JRSwizzle.h>