Skip to content

Instantly share code, notes, and snippets.

View tamakiii's full-sized avatar

Daichi Tamaki tamakiii

  • undefined
  • Shibuya, Tokyo, Japan
  • X @tamakiii
View GitHub Profile
<?php
define('KEY_ID', 0);
define('KEY_DATE', 1);
/**
* @param array $reports
* @param string $start
* @param string $end
* @return array
<?php
define('KEY_ID', 0);
define('KEY_DATE', 1);
/**
* @param array $reports
* @param string $start
* @param string $end
* @return array
#!/bin/sh
run() {
number=$1
shift
for i in `seq $number`; do
START=$(gdate +%s.%N)
$@
END=$(gdate +%s.%N)
echo "$END - $START" | bc
<?php
/**
* PHP 5.5.16 (cli) (built: Apr 1 2015 22:23:30)
* Copyright (c) 1997-2014 The PHP Group
* Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
* with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
* with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
*/
<?php
namespace Acme\Util\Time;
class RangeSeparator
{
/**
* @param string $start
* @param string $end
* @param string $daily
<?php
interface TraversableOperatorInterface
{
/**
* @param Traversable $rows
* @param callable $callable
* @return Generator
*/
public function append(Traversable $rows, callable $callable);
@tamakiii
tamakiii / .vimrc
Last active December 15, 2015 14:39
" 基本設定(表示)
syntax on
filetype on
filetype indent on
filetype plugin on
" 基本設定(編集)
set nowrap
<?php
class Hoge
{
/**
* "ID" が大文字."Id" ではない
*/
public function getID()
{
return 123;
@tamakiii
tamakiii / list.php
Last active April 12, 2016 07:59
How list() works.
<?php
<?php
$data = [
'[1,2]' => [1, 2],
'[]' => [],
'[null,null]' => [null, null],
'null' => null,
"''" => '',

Macの移行アシスタント(Migration Assistant)を使う際の注意点

  • 移行先のOSは最新版でなければならない
  • Yosemite移行の際は/usr/localを移しておく必要がある
  • 途中で強制終了してもストレージを食うので再実行前には消す
  • 画面が暗いままになっていて、強制終了して再起動してもその状態が続くなら、PRAMクリアすふと直るかもしれない(command + option + P + R)
  • rbenvがopenssl云々のエラーで使えない場合は再インストールが必要
  • apple-gcc42が入っていると失敗する
  • brew uninstall apple-gcc42
  • cocoapodsが壊れてるっぽいときはpod setupで直るかも