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 org.apache.catalina.LifecycleListener; | |
import org.apache.catalina.core.AprLifecycleListener; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory; | |
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
/** | |
* NOTE: You also need to install APR on your system, on Arch Linux the package is called `tomcat-native`. |
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
<meta charset="utf-8"> | |
<body onload='myInit()'> | |
<canvas id='myCanvas'></canvas> | |
<map name="Map" id="Map"> | |
<area shape="rect" onmouseover='myHover(this);' onmouseout='myLeave();' coords="50,50,70,80" href="#" alt="circle" /> | |
</map> | |
<img id="img" src="index.jpeg" width="100%" usemap="#Map" /> | |
<script> |
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); |
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
// 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
<!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
<!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
<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
$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
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 | |
} | |
NewerOlder