Skip to content

Instantly share code, notes, and snippets.

View mactive's full-sized avatar
🎯
Focusing

mactive mactive

🎯
Focusing
View GitHub Profile
@mactive
mactive / CommonListViewController.h
Created April 1, 2014 08:25
类簇 抽象工厂
//
// //
// //
// CommonListViewController.h
// bitmedia
//
// Created by meng qian on 14-1-22.
// Copyright (c) 2014年 thinktube. All rights reserved.
//
#import <UIKit/UIKit.h>
@mactive
mactive / Notification Center
Last active August 29, 2015 14:02
Notification Center
// Instead of using delegation for passing the data, consider using NSNotificationCenter to communicate between your view controllers in this situation.
// In your first view controller you will register to listen for a notification:
- (void)viewDidLoad
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleFourthViewSubmit:)
name:@"fourthViewSubmit"
object:nil];
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
@mactive
mactive / cityList.coffee
Created August 24, 2015 10:49
Promise Sequences
cityList = [
{key: "610100", label:"西安", daLabel:"西安市",region:"华南"},
{key: "130100", label:"石家庄", daLabel:"石家庄市",region:"华南"},
{key: "350200", label:"厦门", daLabel:"厦门市",region:"华南"},
{key: "410100", label:"郑州", daLabel:"郑州市",region:"华南"},
{key: "440600", label:"佛山", daLabel:"佛山市",region:"华南"},
{key: "350100", label:"福州", daLabel:"福州市",region:"华南"},
{key: "440100", label:"广州", daLabel:"广州市",region:"华南"},
{key: "230100", label:"哈尔滨", daLabel:"哈尔滨市",region:"华南"},
{key: "110100", label:"北京", daLabel:"北京市",region:"华南"},
@mactive
mactive / clean onecity test db
Created March 27, 2011 14:19
clean onecity test db
UPDATE `lenovo_one`.`sm_category`
SET `is_upload` = '0',`is_audit_confirm` ='0',`audit_status` ='0'
WHERE `sm_category`.`cat_id` > 1;
TRUNCATE TABLE `sm_city`;
TRUNCATE TABLE `sm_city_audit`;
TRUNCATE TABLE `sm_city_ad`;
TRUNCATE TABLE `sm_city_temp`;
TRUNCATE TABLE `sm_city_gallery`;
@mactive
mactive / gist:949586
Created April 30, 2011 10:23
urldecode and urlencode
<?php
function url_encode($string){
return urlencode(utf8_encode($string));
}
function url_decode($string){
return utf8_decode(urldecode($string));
}
?>
@mactive
mactive / gist:967885
Created May 12, 2011 03:34
在Android中发送HTTP POST请求示范
public void MyFunction{
HttpClient httpclient = new DefaultHttpClient();
//你的URL
HttpPost httppost = new HttpPost("http://www.eoeandroid.com/post_datas.php");
try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
//Your DATA
nameValuePairs.add(new BasicNameValuePair("id", "12345"));
nameValuePairs.add(new BasicNameValuePair("stringdata", "eoeAndroid.com is Cool!"));
@mactive
mactive / gist:3186599
Created July 27, 2012 07:12
profileJson
{"success":true,"data":{"user_id":"24","user_ticket":"1-18","avatar":"","firstname":"m","lastname":"acti","name":"mactive","enname":"mactive","email":"mactive@gmail.com","company_ticket":"1","logined":1343301090,"telephone":"","cellphone":"","created":"1343228570","updated":"1343228570"}}
@mactive
mactive / css
Created August 6, 2012 02:07 — forked from asdsasd555/css
html file
/* upload-popup */
.upload-popup-all {position: absolute;width:281px;padding: 10px;border:1px solid #959ba5;background-color: #eef0f3;}
.upload-popup-all .describe {float:left;font-size:13px;line-height:123%;color:rgb(101,101,101);text-shadow:0px 1px 0px rgba(255,255,255,0.5);}
.upload-popup-all .details {float: right; color: #3e9de3;text-decoration: underline;}
.upload-popup-all .schedule {height: 14px;width:280px;margin-top: 3px;position: relative;background:url(../images/upload-fffbg.png) no-repeat;/*overflow:hidden;*/}
.upload-popup-all .schedule-bg {height: 11px;width:100%;position: absolute;bottom:1px;border:1px solid #3e9de3;background-color: #6dbef2;}
.upload-popup-all .schedule-com-bg {height: 11px;width:100%;position: absolute;border:1px solid #70b05c;background-color: #ace17d;}
.upload-popup-all ul {max-height:131px;margin-top: 15px;margin-bottom: 10px;border: 1px solid #b2b9bd;overflow: auto;}
.upload-popup-all li:last-child {margin-bottom: 0;}
.upload-popup-list {height:25px;width:100px; text-ind
@mactive
mactive / gist:3712931
Created September 13, 2012 08:40
drawQuadrant
/*
* countPerLine 每行个数
* qWidth 象限宽度 qHeight 象限高度
* sHeihgt 象限间隔
* x1,y1 左上角 x2,y2 右上角
*/
File.prototype.drawQuadrant = function( countPerLine, qWidth, qHeight, sHeight){
var self = this;
countPerLine = countPerLine ? countPerLine : 4 ;
qWidth = qWidth ? qWidth : 150 ;