Skip to content

Instantly share code, notes, and snippets.

<?php
class Hoge
{
function __construct()
{
}
}
class Fuga extends Hoge
{
function __construct($foo)
@cockok
cockok / sample.php
Last active August 29, 2015 13:59
Indirect modification of overloaded property Hoge::$hage has no effect in ...
<?php
class Hoge {
private $data = array();
public function __get($key) {
return array_key_exists($key, $this->data) ? $this->data[$key] : null;
}
public function __set($key, $value) {
return $this->data[$key] = $value;
}
}
<?php
echo 1000;
@cockok
cockok / logbook
Last active August 29, 2015 14:03
logbook log paser
#!/usr/bin/env ruby
# coding: utf-8
# for http://kancolle.sanaechan.net/
require 'date'
require 'optparse'
# parse options
option_hash = {}
@cockok
cockok / kancolle-ss-mask
Last active August 29, 2015 14:04
艦これキャプチャの提督名マスク
convert -fill black -draw 'rectangle 113,2 270,23' ~/Dropbox/艦これ/`ls -t1 ~/Dropbox/艦これ | head -1` ~/Dropbox/艦これ/out.png; open $_
@cockok
cockok / fixed-grub.md
Last active February 4, 2018 08:55
GRUBの修復
package main
import (
"flag"
"fmt"
)
func main() {
var (
boolFlag bool
@cockok
cockok / install.sh
Created February 9, 2015 16:40
homebrew
brew tap caskroom/cask
brew tap homebrew/completions
brew tap homebrew/dupes
brew tap homebrew/python
brew tap homebrew/science
brew tap josegonzalez/php
brew tap peco/peco
brew install apple-gcc42 autoconf automake bash-completion bison boot2docker brew-cask celt cgdb cloog cmake docker eigen faac fdk-aac ffmpeg fig fontconfig freetype fribidi gcc gdb gdbm gettext gmp go go-app-engine-64 heroku-toolbelt hub icu4c ilmbase imagemagick isl jasper jpeg jq lame libass libmpc libogg libpng libtiff libtool libvo-aacenc libvorbis libvpx libyaml little-cms2 mercurial mpfr node numpy opencore-amr opencv openexr openjpeg openssl opus orc peco php55 pkg-config qt rbenv readline rename ruby-build schroedinger sdl shtool speex sqlite tbb texi2html theora unixodbc vagrant-completion vim wget x264 xvid xz yasm zlib
brew cask install atom vagrant virtualbox
#!/bin/sh
BASENAME=$(basename $1)
ffmpeg -i $1 -s hd480 -c:v libx264 -crf 22 -c:a libfdk_aac -vsync passthrough ${BASENAME%.*}.mp4
@cockok
cockok / Dockerfile
Created December 22, 2020 13:49
composer with intl
FROM composer
RUN set -eux; \
apk add --no-cache --virtual .cakephp-rundeps \
icu-libs
RUN set -eux; \
apk add --no-cache --virtual .build-deps \
icu-dev \
icu-libs \