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
@annidy
annidy / FMDatabase+UserVer.h
Created December 16, 2014 07:12
FMDB userver 扩展
#import "FMDatabase.h"
@interface FMDatabase (UserVer)
@property (nonatomic) int userVer;
@end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.xcode_ramdisk.agent</string>
<key>ProgramArguments</key>
<array>
<string>xcode_ramdisk.sh</string>
<string>start</string>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
void oc_dump(uint8_t *buf, size_t len)
{
int i;
char *c;
#import "NSData+OADataHelpers.h"
@implementation NSData (OADataHelpers)
- (NSString*) UTF8String
{
// First we try strict decoding to avoid iconv overhead when not needed (majority of cases).
NSString* str = [[[NSString alloc] initWithData:self encoding:NSUTF8StringEncoding] autorelease];
if (!str)
{
@annidy
annidy / map.lua
Last active May 4, 2018 02:37
Xcode link map文件的lua分析脚本
#!/usr/bin/env lua
-- http://www.jianshu.com/p/92a041b1b825
obj_tbl = {} -- {[3]={file, module}}
syb_tbl = {} -- {[3]=47}
filter_tbl = nil -- {'Test.o'}
appname = nil
function process_object(line)
@annidy
annidy / xcode.lua
Last active November 25, 2015 07:03
-- make xcode work on my iPhone
filename = arg[1]
mycodesign = "iPhone Developer: jie zhao (BF2E4X5CV7)"
if not string.find(filename, "project.pbxproj$") then
print("Usage: "..arg[0].." project.pbxproj")
os.exit(1)
end
@annidy
annidy / test.m
Last active January 30, 2023 03:25
NSCharacterSet example
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
#!/bin/bash
ssh -p 2222 root@localhost "/sbin/hfs_uti /dev/rdisk0s2s1 cat /.journal" > my.journal
ssh -p 2222 root@localhost "/sbin/hfs_uti /dev/rdisk0s1s2 cat /.journal" > my.journal
@annidy
annidy / jpgrec.py
Created February 9, 2016 07:57
JPG照片修复
# -*- coding: utf8 -*-
# !/usr/bin/env python
__author__ = 'fengxing'
__date__ = '2012-1-18 20:13'
import sys
@annidy
annidy / main.c
Last active May 13, 2016 15:45
leetcode binary tree loader
// create by annidy
// 2016-05-13
#include <stdio.h>
#include <utlist.h>
#include <string.h>
#include <stdlib.h>
struct TreeNode {
int val;
struct TreeNode *left;