-
ファイル名
views/helpers/image_utility.php
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 | |
error_reporting(-1); | |
set_time_limit(0); | |
require_once "./twitteroauth/twitteroauth/twitteroauth.php"; | |
$twitter = new TwitterOAuth( | |
{Consumer key}, | |
{Consumer secret}, | |
{Access token}, | |
{Access token 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
function SampleWindow(_title) { | |
var self = Ti.UI.createWindow({ | |
title : _title, | |
backgroundColor : 'white' | |
}); | |
return self; | |
} | |
module.exports = SampleWindow; |
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 | |
// ファイルの最終更新時間を求める(初めて使った...) | |
filemtime(ABSOLUTE_FILE_PATH); |
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 | |
// 配列キーの最大値を求める(初めて使った...) | |
max(array_keys($arr)) |
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
#!/bin/bash | |
i=0 | |
while [ $i -ne 100000 ] | |
do | |
account=`expr 1 + $RANDOM % 10` | |
service=$(pwgen 10 1) | |
method=$(pwgen 50 1) | |
calls=`expr 1 + $RANDOM % 10` | |
items=`expr 1 + $RANDOM % 10` |
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
$ rvm install 1.9.2 | |
$ rvm use 1.9.2 | |
$ rvm gemset create rails3.2 | |
$ rvm use 1.9.2@rails3.2 | |
$ gem install heroku | |
$ gem install taps | |
$ heroku db:push sqlite://{SQLITE_DATABASE_PATH} --app {HEROKU_APP_NAME} |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'github_api' | |
require 'hashie' | |
github = Github.new | |
results = github.search.repos keyword: 'dotfiles' | |
results.repositories.each do |result| | |
puts result.url unless result.url.empty? |
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
lib/Cake/Console/ConsoleOutput.php | |
正規表現エンジンが古いのが原因 | |
l.181 | |
return preg_replace_callback( | |
'/<(?<tag>[a-z0-9-_]+)>(?<text>.*?)<\/(\1)>/ims', array($this, '_replaceTags'), $text | |
); |
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
// sqlを2回に分ける | |
// order by rand() は全件走査になるので、まずid(主キー)だけのリストを作り | |
select users.id # idだけ取得 | |
from users | |
where {CONDITIONS} | |
order by rand() | |
// その後インデックスが効くようにid縛りのクエリを発行 | |
select {COLUMN} |