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(){ | |
Window = require('map_view'); | |
var win = new Window({ | |
title:'map' | |
}); | |
win.open(); | |
})(); |
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 mapview(_args) { | |
var win = Titanium.UI.createWindow({ | |
title:_args.title | |
}); | |
var isAndroid = false; | |
var MapModule = Titanium.Map; | |
var MapType = MapModule.STANDARD_TYPE; | |
if (Titanium.Platform.name == 'android') { | |
isAndroid = 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
require 'active_support/core_ext/hash' | |
module GeoUtils | |
extend self | |
# 様々な緯度経度フォーマットのデータを入出力する関数 | |
# 入力: 以下の5パターンの引数が想定されている | |
# lat lng FORMAT 数値二つ | |
# "lat" "lng" FORMAT 文字列二つ | |
# "lat,lng" FORMAT カンマ区切りの文字列一つ | |
# [lat,lng] FORMAT 配列 |
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 | |
$output = ''; | |
$comment = 'あいうえお'; | |
if (isset($_POST['comment'])){ | |
$comment = $_POST['comment']; | |
if (preg_match("/[あ-ん]/", $comment)) | |
{ | |
$outputs = Array(); | |
$outputs[] = 'MATCH'; | |
$outputs[] = 'ret:'.preg_match("/[あ-ん]/", $comment, $match,PREG_OFFSET_CAPTURE); |
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
var paramstr = ''; | |
for (var key in params) { | |
if (params[key] instanceof Array){ | |
for (var i = 0; i < params[key].length; i++) { | |
paramstr = paramstr+key+'[]='+params[key][i]+'&'; | |
} | |
}else{ | |
paramstr = paramstr+key+'='+params[key]+'&'; | |
} | |
} |
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 | |
App::uses('Model', 'Model'); | |
class AppModel extends Model { | |
public $findMethods = array('noModelName' => true); | |
protected function _findNoModelName($state, $query, $results = array()) { | |
if ($state == 'before') { | |
return $query; | |
} elseif ($state == 'after') { | |
$modelNameKey = $this->name.'.'; | |
$resultsNoModelName = array(); |
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
LOOP = 10000000; | |
var start, end; | |
// logging | |
function log(msg){ | |
return console.log(msg); | |
} | |
function checkStrTernary(arg){ | |
start = new Date(); |
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 | |
/** | |
* Copyright 2013 mogya. | |
* Copyright 2011 Facebook, Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may | |
* not use this file except in compliance with the License. You may obtain | |
* a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.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
<?php | |
App::import('Vendor', 'facebook/facebook'); | |
class FacebookController extends AppController{ | |
protected $facebook = NULL; | |
function beforeFilter(){ | |
$this->facebook = new Facebook(array( | |
'appId' => Configure::read('facebook.appid'), | |
'secret' => Configure::read('facebook.secret'), | |
)); |
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
<? | |
include_once("facebook/facebook.php"); //include facebook SDK | |
function myurl(){ | |
if ( isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on' ){ | |
$protocol = 'https://'; | |
}else{ | |
$protocol = 'http://'; | |
} | |
return $protocol.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; |