Skip to content

Instantly share code, notes, and snippets.

View mactive's full-sized avatar
🎯
Focusing

mactive mactive

🎯
Focusing
View GitHub Profile
@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 ;
@mactive
mactive / gist:3747575
Created September 19, 2012 03:48
php插件地址
/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/
@mactive
mactive / gist:3916905
Created October 19, 2012 08:17
UITableViewCellSelectionStyleNone
cell.selectionStyle = UITableViewCellSelectionStyleNone;
//设置了成了 StyleNone 之后
cell.selectedBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cell_bg_highlighted.png"]];
//不起作用
@mactive
mactive / gist:3950269
Created October 25, 2012 03:32
Global UINavigationBar style
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque animated:NO];
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navigationBar_bg.png"] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:121/255 green:123/255 blue:126/255 alpha:1.0] ];
[[UIBarButtonItem appearance] setTintColor:RGBACOLOR(55, 61, 70, 1)];
@mactive
mactive / gist:3951751
Created October 25, 2012 09:58
shake me 摇一摇
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
application.applicationSupportsShakeToEdit = YES;
}
shakeViewController.m
-(BOOL)canBecomeFirstResponder {
return YES;
}
-(void)viewDidAppear:(BOOL)animated {