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
from django.http import HttpResponse | |
from django.shortcuts import render_to_response | |
def helloworld(request): | |
return render_to_response('test.html', {'title': 'djangoTest!'}) |
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 debugLog($label, $val) { | |
static $filename = 'logs/debug.log'; | |
$mtime = microtime(); | |
$timeStmp = explode(' ', $mtime); | |
$time = date('Y-m-d H:i:s', (int)$timeStmp[1]); | |
$mtime = number_format($mtime,5); | |
$val = var_export($val, 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 | |
App::uses('Helper', 'View'); | |
class AppHelper extends Helper { | |
/** | |
* CakeがHTMLを出力する際に生成される無駄なタブを削除する。 | |
* @see Helper::afterLayout() | |
*/ | |
public function afterLayout($layoutFile) { | |
parent::afterLayout($layoutFile); | |
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 { | |
/** | |
* モデルの空配列を返します。 | |
* @return array モデルの空配列 | |
*/ | |
public function getModelArray() { | |
//カラムタイプの配列からキーのみを取得 | |
$keys = array_keys($this->getColumnTypes()); |
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 bench() { | |
//計測回数 | |
$count = 10; | |
//試行回数 | |
$testCount = 100000; | |
//小数点桁数 | |
$decimalDigits = 10; | |
//平均値 | |
$average = 0.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
# -*- coding: cp932 -*- | |
import wx | |
class MyFrame(wx.Frame): | |
def __init__(self, parent, title): | |
wx.Frame.__init__(self, parent, title=title, size=(500,500),pos=(10,10)) | |
#ステータスバー | |
self.CreateStatusBar() | |
#ファイルメニュー | |
filemenu = wx.Menu() |
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 Spinner = function() { | |
/** | |
* ランダムでIDを生成する | |
*/ | |
this.id = 'spinner' + Math.floor(Math.random () * 10000) + 1; | |
}; | |
Spinner.prototype = { |
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
/** | |
* main | |
*/ | |
function main() { | |
var tagName = 'php'; | |
var questionUrl = 'https://teratail.com/questions/'; | |
var response = getQuestionByTagName(tagName, {limit: 3}); | |
if(!'questions' in response) { | |
return false; | |
} |
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 defer_stylesheet() { | |
$styles = array( | |
'//fonts.googleapis.com/css?family=Lato:300,400,400italic,600,700|Raleway:300,400,500,600,700|Crete+Round:400italic', | |
'//fonts.googleapis.com/earlyaccess/notosansjapanese.css', | |
get_template_directory_uri(). '/css/bootstrap.css', | |
); | |
$styles = json_encode($styles); | |
echo <<<SCRIPT | |
<script> |
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 | |
namespace App\Controller\Component; | |
use \google\appengine\api\mail\Message; | |
use Cake\Controller\Component; | |
/** | |
* メール送信を行うコンポーネント | |
*/ | |
class MailComponent extends Component | |
{ |
OlderNewer