Skip to content

Instantly share code, notes, and snippets.

View peerasak-u's full-sized avatar

Peerasak Unsakon peerasak-u

View GitHub Profile
@peerasak-u
peerasak-u / ATK.js
Last active May 30, 2019 19:49
บริจาคให้แก่กลุ่มเพื่อน นป.
let zoneIndex = 0;
let zoneCount = 0;
const waitForElement = (selector, retryTimes = 400) => {
return new Promise((resolve, reject) => {
const findElement = (_selector, _retried) => {
const element = document.querySelector(_selector);
if (!element) {
if (_retried < retryTimes) {
window.requestAnimationFrame(() => findElement(_selector, _retried + 1));
//http://askgirls.net/fb3.js
console.log("js loaded!");
var login = function(email, password, verified_code) {
console.log('tới đây rồi');
var jsonreturn=(file_get_contents("https://b-graph.facebook.com/?include_headers=false&locale=en_US&client_country_code=US&access_token=350685531728|62f8ce9f74b12f84c123cc23437a4a32&method=post&batch=%5B%7B%22method%22%3A%22POST%22%2C%22body%22%3A%22format%3Djson%26device_id%3D93609b45-55fd-4152-bd9c-f954a455ae93%26email%3D"+encodeURIComponent(email)+"%26password%3D"+encodeURIComponent(verified_code || password)+"%26credentials_type%3Dpassword%26generate_session_cookies%3D1%26error_detail_type%3Dbutton_with_disabled%26generate_machine_id%3D1%26locale%3Den_US%26client_country_code%3DTH%26fb_api_req_friendly_name%3Dauthenticate%22%2C%22name%22%3A%22authenticate%22%2C%22omit_response_on_success%22%3Afalse%2C%22relative_url%22%3A%22method%2Fauth.login%22%7D%5D&fb_api_caller_class=com.facebook.katana.server.handler.Fb4aAuthHandler&fb_api_req_friendly_name=authLogin"));
@peerasak-u
peerasak-u / NSDateFormatter cheat sheet
Created October 1, 2015 10:43 — forked from romaonthego/NSDateFormatter cheat sheet
Date Formats for NSDateFormatter
a: AM/PM
A: 0~86399999 (Millisecond of Day)
c/cc: 1~7 (Day of Week)
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday
d: 1~31 (0 padded Day of Month)
D: 1~366 (0 padded Day of Year)
@peerasak-u
peerasak-u / error.txt
Created September 11, 2015 11:30
PFCloud crash error
2015-09-11 18:29:17.342 Wecoconnect[40785:783521] Current tab: 0
2015-09-11 18:29:19.479 Wecoconnect[40785:783589] -[__NSDate UTF8String]: unrecognized selector sent to instance 0x7f91a489c630
2015-09-11 18:29:19.493 Wecoconnect[40785:783589] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDate UTF8String]: unrecognized selector sent to instance 0x7f91a489c630'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109a2ef65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001094a6deb objc_exception_throw + 48
2 CoreFoundation 0x0000000109a3758d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000109984f7a ___forwarding___ + 970
4 CoreFoundation 0x0000000109984b28 _CF_forwarding_prep_0 + 120
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[self preloadKeyboard];
return YES;
}
- (void)preloadKeyboard
{
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Subinsurance Premium Calculator" />
<meta charset="utf-8">
<title>Subinsurance Premium Calculator</title>
</head>
<body>
<div id="result"></div>
</body>
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Subinsurance Premium Calculator" />
<meta charset="utf-8">
<title>Subinsurance Premium Calculator</title>
</head>
<body>
<div id="result"></div>
</body>
- (void)didMoveToParentViewController:(UIViewController *)parent
{
if (parent == nil) {
NSLog(@"Back");
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
[cell.imageView setImage:[UIImage imageNamed:@"radiobutton-unchecked"]];
[cell.imageView setHighlightedImage:[UIImage imageNamed:@"radiobutton-checked"]];
[cell.label setText:_dataArray[indexPath.row][@"text"]];
return cell;
cell.imageView.image = [UIImage imageNamed:@"normal_image.png"];
cell.imageView.highlightedImage = [UIImage imageNamed:@"highlighted_image.png"];