This file contains 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
//Generate Encoded Polyline Algorithm Format for Google Static Maps API | |
// http://bit.ly/sw3deL (Japanese) | |
// http://bit.ly/tnKt4m (English) | |
function encodeGPolyline(path){ | |
var enc = ""; | |
var old = true; | |
for(c in path){ | |
var latlng = path[c]; | |
if(old === true){ |
This file contains 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
<?php | |
function getDirection($point1,$point2){ | |
$lat1 = $point1->lat; | |
$lng1 = $point1->lng; | |
$lat2 = $point1->lat; | |
$lng2 = $point1->lng; | |
$Y = cos($lat2) * sin($lng2 - $lng1); | |
$X = cos($lat1) * sin($lat2) - sin($lat1) * cos($lat2) * cos($lng2 - $lng1); | |
$a = atan2($Y, $X); | |
if($a <0){ |
This file contains 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
function getDistance(point1,point2){ | |
var my = ((point1.lat + point2.lat) / 2.0) * Math.PI / 180.0; | |
var dy = (point1.lat - point2.lat) * Math.PI / 180.0; | |
var dx = (point1.lng - point2.lng) * Math.PI / 180.0; | |
var w = Math.sqrt(1.0 - 0.0066943799901975 * Math.pow(Math.sin(my),2)); | |
return Math.sqrt(Math.pow(dy * 6335439.32729246 / Math.pow(w,3),2) | |
+ Math.pow(dx * 6378137.000 * Math.cos(my) / w,2)); | |
} |
This file contains 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 lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>TM Labo: Google API - 読み上げ機能(非公式API)</title> | |
<style> | |
/* 等幅にしておく */ | |
* { | |
font-family: monospace; | |
} |
This file contains 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" src="ext-core.js"></script> | |
<script> | |
var Cell = function(){ | |
this.status = false; | |
this.numAlive = 0; | |
} | |
Cell.prototype.getNext = function(){ |
This file contains 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> | |
<link rel="stylesheet" type="text/css" href="http://extjs-public.googlecode.com/svn/extjs-4.x/release/resources/css/ext-all.css" /> | |
<script type="text/javascript" src="http://extjs-public.googlecode.com/svn/extjs-4.x/include/ext-all.js"></script> | |
<script type="text/javascript"> | |
Ext.onReady(function(){ | |
var touchInf = {}; | |
Ext.getDom("panel").addEventListener("touchstart",function(e){ | |
for(var c = 0; c < e.changedTouches.length; c++){ |
This file contains 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
StartServers 5 | |
MinSpareServers 5 | |
MaxSpareServers 10 | |
MaxClients 256 |
This file contains 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
sudo yum update |
This file contains 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
#ユーザを追加する | |
sudo useradd yokoyama | |
#ユーザにパスワードを付与する | |
sudo passwd yokoyama | |
#ここで(パスワードを二回入力する) | |
#ユーザがsudo出来るようにする | |
sudo usermod -G wheel -a yokoyama |
This file contains 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
#ファイアウォールでWebサーバへの接続を許可する | |
sudo firewall-cmd --add-service=http | |
sudo firewall-cmd --permanent --add-service=http | |
#SELinuxを無効にする | |
sudo setenforce 0 | |
#次回立ち上げ時もSELinuxを無効にする | |
sudo vi /etc/sysconfig/selinux | |
#ここからはviエディタでの作業になります。 |