Skip to content

Instantly share code, notes, and snippets.

View nojimage's full-sized avatar

Takashi Nojima nojimage

View GitHub Profile
@nojimage
nojimage / docker-gitlab.conf
Last active August 29, 2015 14:07
upstart docker jenkins and gitlab
description "gitlab service runner"
start on filesystem and started docker.io
stop on runlevel [!2345]
kill signal CONT
normal exit 0 CONT
respawn
setuid manager
@nojimage
nojimage / ssh_config
Created October 10, 2014 04:23
OSXのboot2dockerにssh接続するための ssh config
Host docker
Hostname 192.168.59.103
User docker
IdentityFile ~/.ssh/id_boot2docker
@nojimage
nojimage / gist:b7852ed3543ae64747b3
Last active August 29, 2015 14:10
Phake 1.0.5 patch for CakePHP 1.x & PHP5.2.x
--- a/src/Phake/ClassGenerator/MockClass.php
+++ b/src/Phake/ClassGenerator/MockClass.php
@@ -230,9 +230,15 @@ class {$newClassName} {$extends}
{
\$args = array();
{$this->copyMethodParameters($method)}
-
- \$answer = \$this->__PHAKE_handlerChain->invoke(\$this, '{$method->getName()}', func_get_args(), \$args);
-
+

/* Title: 草稿 Author: nojimage */

草稿

キャッチ/リード

  • 佐賀県に樋渡啓祐は必要ありません
@nojimage
nojimage / env.php
Created December 11, 2014 11:39
phpdotenvで環境別設定を切り替えるための読み込みファイル
<?php
/**
* This file read before Configure::load('app')
*/
use Dotenv;
/**
* required setting
*/
@nojimage
nojimage / timecop
Last active August 29, 2015 14:13
php-build after-install.d
#!/usr/bin/env bash
TMP="/var/tmp/php-build"
PHP="/usr/bin/env php"
download_timecop() {
local timecop_url="$1"
if [ -z "$timecop_url" ]; then
timecop_url="https://github.com/hnw/php-timecop.git"
#!/bin/env bash
##
# CVE-2015-0235 restart all services that using `glibc`
#
# original code:
# http://ma.ttias.be/critical-glibc-update-cve-2015-0235-gethostbyname-calls/#comment-10890
##
servicelist="";
for problemservice in `/usr/sbin/lsof 2> /dev/null | grep libc | awk '{print $1}' | sort -u`; do
@nojimage
nojimage / netbeans-baser-phpunit.sh
Created March 20, 2015 13:45
NetBeansからVagrant上のbaserCMSのテストを実行するためのスクリプト
#!/usr/bin/env bash
##
# Custom PHPUnit script for Remote test on NetBaeans 8.0
##
#
# Change these settings to your env
#
REMOTE_PKEY=~/.vagrant.d/insecure_private_key
REMOTE_SERVER=vagrant@192.168.33.10
@nojimage
nojimage / SwitchTestDatasource.php
Last active August 29, 2015 14:22
Switching datasource to test for CakePHP 3.x
<?php
/**
*
* Copyright 2015 ELASTIC Consultants Inc.
*
*/
namespace App\Routing\Filter;
@nojimage
nojimage / Inflector.diff
Last active August 29, 2015 14:22
Inflector fix
diff --git a/lib/Cake/Utility/Inflector.php b/lib/Cake/Utility/Inflector.php
index 61a63c2..48b9fa1 100644
--- a/lib/Cake/Utility/Inflector.php
+++ b/lib/Cake/Utility/Inflector.php
@@ -497,7 +497,7 @@ class Inflector {
public static function humanize($lowerCaseAndUnderscoredWord) {
if (!($result = self::_cache(__FUNCTION__, $lowerCaseAndUnderscoredWord))) {
$lowerCaseAndUnderscoredWord = self::underscore($lowerCaseAndUnderscoredWord);
- $result = explode(' ', str_replace('_', ' ', $lowerCaseAndUnderscoredWord));
+ $result = explode(' ', str_replace(['_', '.'], [' ', '. '], $lowerCaseAndUnderscoredWord));