Skip to content

Instantly share code, notes, and snippets.

View ko31's full-sized avatar
I want to play catch!

Ko Takagi ko31

I want to play catch!
View GitHub Profile
@ko31
ko31 / coroton.svg
Created October 18, 2015 23:30
【Lazy Line Painter】ころとん
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ko31
ko31 / gist:e894fe5b8b773c84e323
Created November 13, 2015 03:20
【WP-CLI】wp search-replaceでURL置換
wp search-replace 'http://example.com' 'http://example.jp'
@ko31
ko31 / gist:4773a622b1c7c18e953e
Created November 13, 2015 03:21
【WP-CLI】wp search-replaceでURL置換(ネットワーク対応)
wp search-replace --network 'http://example.com' 'http://example.jp'
@ko31
ko31 / gist:1789b933ed1b44c1fce5
Created November 13, 2015 03:21
【WP-CLI】wp search-replaceでURL置換(全テーブル)
wp search-replace --all-tables 'http://example.com' 'http://example.jp'
@ko31
ko31 / gist:ffc70b53486fb397db53
Created November 13, 2015 03:32
【MySQL】dummy
mysql> create table company (company_id int AUTO_INCREMENT primary key, name text, url text);
mysql> insert into company values (1,'a', 'http://example.com'),(2,'b','http://example.jp'),(3,'c','http://example.net');
@ko31
ko31 / adventar.php
Created November 17, 2015 17:55
【PHP】Adventarの登録状況をスクレイピング
<?php
// コマンドラインのみ
if (php_sapi_name() != 'cli') {
exit('Service Unavailable');
}
require_once 'goutte.phar';
use Goutte\Client;
$client = new Client();
// Adventarの2015年一覧ページをGET
$crawler = $client->request('GET', 'http://www.adventar.org/calendars?year=2015');
@ko31
ko31 / index.html
Created November 17, 2015 17:57
【D3.js】Adventar登録状況のツリーマップ
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>【Adventar】2015年アドベントカレンダー登録状況</title>
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: auto;
position: relative;
width: 960px;
@ko31
ko31 / Batch.php
Created December 9, 2015 10:03
【CodeIgniter】コントローラサンプル
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Batch extends CI_Controller {
public function sample()
{
echo "done!".PHP_EOL;
}
}
@ko31
ko31 / Batch.php
Last active December 9, 2015 10:16
【CodeIgniter】コントローラサンプル
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Batch extends CI_Controller {
public function sample($first_name = 'Ichiro', $last_name = 'Suzuki')
{
echo "Hello {$first_name} {$last_name}!".PHP_EOL;
echo "done!".PHP_EOL;
@ko31
ko31 / Batch.php
Created December 9, 2015 10:37
【CodeIgniter】コントローラサンプル
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Batch extends CI_Controller {
public function sample($first_name = 'Ichiro', $last_name = 'Suzuki')
{
if (!is_cli())
{
set_status_header(403);