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
## 3時間ごと | |
every 3.hours do | |
runner "Task::sample.exec" | |
end | |
## 4:30に実行 | |
every :monday, :at => '4:30 am' do | |
runner "Task::sample.exec" | |
end | |
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
# データバックアップ(テーブル単位) | |
mysqldump -u ユーザ名 DB名 -p --default-character-set=binary --tables テーブル名 > backup.sql | |
# データのリストア(テーブル単位) | |
mysql -u ユーザ名 DB名 -p --default-character-set=binary < backup.sql |
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
SELECT id from table_name where date>=ADDDATE(CURDATE(),Interval -7 DAY) | |
SELECT `recruits`.* FROM `recruits` WHERE (keisai_flag = '1' and date_add(current_date, interval -3 day) <= created_at ) |
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
<%if user_signed_in? %> | |
<%= link_to "Sign out", destroy_user_session_path, :method => :delete%> | |
<%end%> |
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
# 初期設定(アプリ毎に行う) | |
cd /pathtoapps/app | |
capify . | |
[add] writing `./Capfile' | |
[add] writing `./config/deploy.rb' | |
[done] capified! | |
# deploy.rbを編集する | |
cap deploy:setup |
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: utf-8 -*- | |
require "twitter" | |
## Twitterのもろもろの情報。 | |
Twitter.configure do |cnf| | |
cnf.consumer_key = "Consumer key" | |
cnf.consumer_secret = "Consumer secret" | |
cnf.oauth_token = "OAuth token" | |
cnf.oauth_token_secret = "OAuth token secret" | |
end |
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 = `ls *.html`; | |
$filelist = preg_split("/\n/",$output); | |
foreach($filelist as $file){ | |
if(empty($file)){ | |
continue; | |
} | |
$fp = fopen($file, "r"); | |
while ($line = fgets($fp)) { | |
if(preg_match("/\<title\>/",$line)){ |
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 deletePost($rpcurl,$username,$password,$post_id) | |
{ | |
// xmlrpc settings | |
$params = array(0,$username,$password,$post_id); | |
// run xmlrpc | |
$request = xmlrpc_encode_request('wp.deletePost', $params); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $request); |
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
ApplicationCotnroller < ActionController::Base | |
NUM = 1 | |
... | |
end |
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
namespace :v3 do | |
get "/test/read",:to=>"test#read" | |
end |
OlderNewer