Skip to content

Instantly share code, notes, and snippets.

View fannheyward's full-sized avatar
🎯
Slow to response

Heyward Fann fannheyward

🎯
Slow to response
View GitHub Profile
@fannheyward
fannheyward / TWRequest+OAuthEcho.h
Created March 21, 2012 08:15
Add OAuth Echo methods to TWRequest
#import <Twitter/Twitter.h>
#import <Accounts/Accounts.h>
@interface TWRequest (OAuthEcho)
/*
* code example:
*
* NSURL *url = [NSURL URLWithString:@"https://api.twitter.com/1/account/verify_credentials.json"];
@fannheyward
fannheyward / build_universal_library.sh
Last active October 12, 2015 17:47 — forked from adamgit/gist:3705459
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.7
#
# Latest Change:
# - Supports iPhone 5 / iPod Touch 5 (uses Apple's workaround to lipo bug)
#
# Purpose:
@fannheyward
fannheyward / build.py
Created November 28, 2012 06:24 — forked from rjyo/build.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import shutil
import json
import getopt
import urllib2
from urllib import urlencode
@fannheyward
fannheyward / build.py
Created November 28, 2012 06:24 — forked from rjyo/build.py
OTA
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import shutil
import json
import getopt
import urllib2
from urllib import urlencode
APP = Pages
WORKSPACE = Pages
CONFIG = InHouse
SCHEME = PagesInHouse
ICON_NAME = Icon@2x.png
BASE_URL = http://beta.nsnotfound.com/pages
EMAIL_LIST = newproject@lexrus.mailgun.org
EMAIL_DOMAIN = lexrus.mailgun.org
SFTP_SERVER = lex@nsnotfound.com
/**
* Loading Indicator
*
* @author Maikel Daloo
* @date 12th March 2013
*
* Creates a new module and intercepts all ajax requests.
* Every time a request is sent, we display the loading message and increment
* the enable_counter variable. Then when requests complete (whether success or error)
* we increment the disable_counter variable and we only hide the loading message
myApp.directive('markdown', function () {
var converter = new Showdown.converter();
return {
restrict: 'AE',
link: function (scope, element, attrs) {
if (attrs.markdown) {
scope.$watch(attrs.markdown, function (newVal) {
var html = converter.makeHtml(newVal);
element.html(html);
});
NginX/NginX OpenResty的内建及扩展模块的phase先后执行次序:
参考: http://wiki.nginx.org/Phases
http://blog.sina.com.cn/openresty
需要关注的phase有:
-1:http config:
在/usr/local/openresty/nginx/conf/nginx.conf的http段落有可以载入lua的共用函数, 比如:
init_by_lua_file /var/workspace/www/violation_nginx/lf;
0.server selection: server(listen, server_name)
# sniproxy example configuration file
# lines that start with # are comments
# lines with only white space are ignored
user daemon
# PID file
pidfile /var/run/sniproxy.pid
resolver {
// Include https://github.com/steipete/Aspects in your project
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[UIButton aspect_hookSelector:@selector(touchesEnded:withEvent:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> info) {
UIButton *button = [info instance];
UIView *topMostView = button.window.subviews.firstObject;
[self logSubviews:topMostView];
} error:nil];
return YES;