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
{ | |
"sublimelinter_executable_map": | |
{ | |
"php": "D:\\php547\\php.exe", | |
"javascript": "C:\\Program Files\\nodejs\\node.exe" | |
}, | |
"sublimelinter_popup_errors_on_save": true | |
} |
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
document.getElementById('someid').addEventListener('touchstart', function(event){ | |
var firstFinger = event.targetTouches[0]; | |
document.getElementById('messageBox').innerHTML = 'point ' + firstFinger.pageX + ',' + firstFinger.pageY + ' touched!'; | |
}, 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
document.getElementById('someid').addEventListener('touchmove', function(event){ | |
var centroid = { x: 0, y: 0 }; | |
for(var i=0; i<event.targetTouches.length; ++i) { | |
centroid.x += event.targetTouches[i].pageX; | |
centroid.y += event.targetTouches[i].pageY; | |
} | |
centroid.x /= event.targetTouches.length; | |
centroid.y /= event.targetTouches.length; | |
document.getElementById('messageBox').innerHTML = 'touch centroid: ' + centroid.x + ',' + centroid.y; |
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
document.getElementById('someid').addEventListener('touchend', function(event){ | |
var touch = event.changedTouches[0]; | |
document.getElementById('messageBox').innerHTML = 'touch end: ' + touch.pageX + ',' + touch.pageY; | |
}, 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
var Touch = { | |
startPos: null, | |
endPos: null, | |
init: function (elementID) { | |
document.getElementById(elementID) | |
.addEventListener('touchstart', | |
function (event) { | |
Touch.start(event); | |
}, 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
CREATE TABLE IF NOT EXISTS `musics` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '編號', | |
`name` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '姓名', | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='音樂單曲資訊' AUTO_INCREMENT=7 ; | |
INSERT INTO `musics` (`id`, `name`) VALUES | |
(1, '愛在西元前'), |
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
$ apt-get update | |
$ apt-get install nginx php5-cgi mysql-server-5.5 php5-mysql |
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
#!/bin/bash | |
BIND=127.0.0.1:9000 | |
USER=www-data | |
PHP_FCGI_CHILDREN=15 | |
PHP_FCGI_MAX_REQUESTS=1000 | |
PHP_CGI=/usr/bin/php5-cgi | |
PHP_CGI_NAME=`basename $PHP_CGI` | |
PHP_CGI_ARGS="- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND" | |
RETVAL=0 |
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
$ chmod +x /etc/init.d/php-fcgi | |
# start the fast cgi | |
$ /etc/init.d/php-fcgi start | |
# stop the fast cgi | |
$ /etc/init.d/php-fcgi stop | |
# restart fast cgi | |
$ /etc/init.d/php-fcgi restart | |
$ update-rc.d php-fcgi defaults |
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
server { | |
root /var/www; | |
index index.php index.html index.htm; | |
location ~ \.php { | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
include /etc/nginx/fastcgi_params; | |
keepalive_timeout 0; | |
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name; |