Skip to content

Instantly share code, notes, and snippets.

<?php
require __DIR__ . '/../vendor/autoload.php';
use PhpParser\Node;
use PhpParser\NodeTraverser;
use PhpParser\NodeVisitorAbstract;
use PhpParser\ParserFactory;
class MyNodeVisitor extends NodeVisitorAbstract
<?php
$p = new Phar('test.phar', FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::KEY_AS_FILENAME);
$p->startBuffering();
$stub = <<<STR
#!/usr/bin/env php
<?php
Phar::mapPhar();
include "phar://test.phar/parent.php";
class NullObject
{
public function __call($name, $arguments)
{
return $this;
}
}
class Klass
{

Keybase proof

I hereby claim:

  • I am gong023 on github.
  • I am gong023 (https://keybase.io/gong023) on keybase.
  • I have a public key ASDJHkqrYTcYS4S7JhWZRJLvHZuFlNrKLSiBFv9lWf7DJAo

To claim this, I am signing this object:

@gong023
gong023 / bench.php
Created December 4, 2015 05:26
bench
<?php
require_once __DIR__ . '/vendor/autoload.php';
class TurmericSample
{
use \TurmericSpice\ReadWriteAttributes {
mayHaveAsInt as public getId;
mayHaveAsFloat as public getBalance;
mayHaveAsString as public getName;
setValue as public setId;
@gong023
gong023 / gist:9d25d3bddc3c180e40b2
Created October 8, 2015 09:11
magicSpirce fake
<?php
trait EntityTrait
{
public function __construct(array $properties = [])
{
foreach ($properties as $k => $v) {
$this->{$k} = $v;
}
}
#!/bin/sh
PHP_VER='5.6.3'
sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo yum install -y mysql mysql-devel mysql-server mysql-utilities --enablerepo=remi
sudo /etc/init.d/mysqld start
mysql -uroot -e 'create database ma_report_test'

対応できないとモグリ

  • snow halation
  • no brand girls
  • それはぼくたちの奇跡
  • 僕らのlive 君とのlife
  • 僕らは今のなかで
  • 愛してるばんざーい(二日目の後半かアンコールぐらいかも?)

1・2日目どちらにきてもおかしくないしどちらかにはくるだろう

  • kira-kira sensation
@gong023
gong023 / gist:3113f39cbe793fa4253c
Last active August 29, 2015 14:13
手元の同人整理する
package main
import (
"fmt"
"os"
"path/filepath"
"regexp"
"runtime"
"sync"
)
#include <stdio.h>
#include <stdlib.h>
struct hoge { int num; };
int* pick_num(struct hoge *h)
{
int *copy = &h->num;
free(&h);
return copy;