This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Handler; | |
import android.os.Message; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.NameValuePair; | |
import org.apache.http.client.ClientProtocolException; | |
import org.apache.http.client.HttpClient; | |
import org.apache.http.client.entity.UrlEncodedFormEntity; | |
import org.apache.http.client.methods.HttpPost; | |
import org.apache.http.impl.client.DefaultHttpClient; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)perform { | |
UIViewController *sourceViewController = self.sourceViewController; | |
UIViewController *destinationViewController = self.destinationViewController; | |
// Add the destination view as a subview, temporarily | |
[sourceViewController.view addSubview:destinationViewController.view]; | |
// Transformation start scale | |
destinationViewController.view.transform = CGAffineTransformMakeScale(0.05, 0.05); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UIViewController,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int { | |
return 2 | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$curl = curl_init(); | |
// Set some options - we are passing in a useragent too here | |
curl_setopt_array($curl, array( | |
CURLOPT_RETURNTRANSFER => 1, | |
CURLOPT_URL => 'http://testcURL.com/?item1=value&item2=value2', | |
CURLOPT_USERAGENT => 'Codular Sample cURL Request' | |
)); | |
// Send the request & save response to $resp | |
$resp = curl_exec($curl); | |
// Close request to clear up some resources |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript"> | |
function validateMyForm() | |
{ | |
if(1 == 6) | |
{ | |
alert("validation failed false"); | |
returnToPreviousPage(); | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | |
<script src="httpreq.js"></script> | |
<script> | |
function chkTxt(){ | |
var str = $("#txt").val(); | |
var b = str.replace(/[^a-z0-9_-]/gi,''); | |
$("#txt").val(b); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<% include ../partials/head %> | |
<title></title> | |
</head> | |
<body> | |
<%= title.date %> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Today.init(); เรียกวันนี้ | |
// Today.prevDate(2); เรียกอีกสองวันข้างหน้า | |
var Today = function(){ | |
return{ | |
init: function () { | |
var today = new Date(); | |
return getDBformat(today); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
// Override point for customization after application launch. | |
if application.respondsToSelector("registerUserNotificationSettings:") { | |
let types:UIUserNotificationType = (.Alert | .Badge | .Sound) | |
let settings:UIUserNotificationSettings = UIUserNotificationSettings(forTypes: types, categories: nil) | |
application.registerUserNotificationSettings(settings) | |
application.registerForRemoteNotifications() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$models=Bla::model()->findAll(); | |
$data=array_map(create_function('$m','return $m->getAttributes(array(\'id\',\'name\'));'),$models); | |
echo json_encode($data); |