Skip to content

Instantly share code, notes, and snippets.

View fawkeswei's full-sized avatar

Fawkes Wei fawkeswei

View GitHub Profile
NSString *path = [NSString stringWithFormat:@"%@/Albums",[friendObject objectForKey:@"id"]];
[_facebook requestWithGraphPath:path andDelegate:self.detailViewController];
@fawkeswei
fawkeswei / gist:1120846
Created August 2, 2011 18:32
invite all friends
javascript:%20var%20fbb_ul%20=%200;%20var%20fbb_li%20=%200;%20var%20ok_ul%20=%200;%20var%20ok_li%20=%200;%20var%20ok_count%20=%200;%20var%20fbb_count%20=%200;%20var%20fbb_elms%20%20=%20document.getElementsByName(%20'checkableitems[]'%20);%20var%20fbb_list%20=%20fbb_elms[0].parentNode.parentNode;%20var%20fbb_div%20=%20fbb_list.parentNode;%20var%20fbb_scroll%20=%20fbb_div.parentNode;%20var%20fbb_continue%20=%20true;%20var%20fbb_prev%20=%200;%20var%20fbb_top%20=%200;%20function%20fbb_click()%20{%20var%20click_force%20=%20false;%20if(ok_count%20<%20fbb_count)%20{%20setTimeout('fbb_click()',%2010);%20}%20else%20{%20while(fbb_div.childNodes[fbb_ul]%20&&%20!click_force)%20{%20fbb_list%20=%20fbb_div.childNodes[fbb_ul];%20while(%20fbb_list.childNodes[fbb_li]%20&&%20!click_force%20)%20{%20node%20=%20fbb_list.childNodes[fbb_li].childNodes[0];%20if(%20!node.checked%20&&%20!node.disabled%20)%20setTimeout(%20'fbb_div.childNodes['+fbb_ul+'].childNodes['%20+%20fbb_li%20+%20'].childNodes[0].click();',%200%20);%20fbb_count%20=
@fawkeswei
fawkeswei / gist:2180961
Created March 24, 2012 10:38
Programming Problem from Cardinal Blue
#############################
# Problem 1: Ruby
#
"i love to code"­.split(" ").ma­p{|x| x.rev­erse}.join­(" ")
#############################
# Problem 2: Same Digits
@fawkeswei
fawkeswei / get_coordinate.js
Created August 16, 2012 06:43
Show the center coordinate of Google Map
// source: http://forums.gpsreview.net/viewtopic.php?t=3632
javascript:void(prompt('',gApplication.getMap().getCenter()));
@fawkeswei
fawkeswei / AFNetworking_post_json.m
Created September 13, 2012 14:39
How to post json data using AFNetworking
NSURL *url = [NSURL URLWithString:@"http://someurl.com/"];
AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
// don't forget to set parameterEncoding!
httpClient.parameterEncoding = AFJSONParameterEncoding;
NSDictionary *params = @{@"key" : @"value"};
NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST" path:@"" parameters:params];
AFHTTPRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:nil failure:nil];
[operation start];
@fawkeswei
fawkeswei / align_center_test.html
Last active December 15, 2015 05:39
align center test
<!DOCTYPE html>
<style type="text/css">
.container {
position: absolute;
width: 100%;
height: 100%;
background-color: green;
}
@fawkeswei
fawkeswei / step1.html
Last active December 21, 2015 22:19 — forked from s9011514/step1.html
<script src="https://gist.github.com/5467780.js"></script>
<test/>