Skip to content

Instantly share code, notes, and snippets.

View tuki0918's full-sized avatar
๐Ÿ 
Working from home

Y.Yamamoto tuki0918

๐Ÿ 
Working from home
View GitHub Profile
@tuki0918
tuki0918 / .zshrc
Created July 3, 2014 13:35
peco: Terminalใ‹ใ‚‰ใŠๆฐ—ใซๅ…ฅใ‚Šใฎใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชใ‚’้–‹ใ
fpath=($HOME/zsh/functions/cd-bookmark(N-/) $fpath)
autoload -Uz cd-bookmark
alias cdb='cd-bookmark'
function peco_open_bookmark() {
cdb | peco | awk -F"|" '{ print $2 }' | xargs open
}
zle -N peco_open_bookmark
bindkey '^@' peco_open_bookmark
@tuki0918
tuki0918 / removekyword.html
Last active August 29, 2015 14:03
hatenablog custom
<script type="text/javascript">
$(function(){
$(".keyword").each(function(){
var $keyword = $(this);
$keyword.before($keyword.text());
$keyword.remove();
});
});
</script>
var a=[],b=$(".ui-scroll-view");if(b)for(var c=b.length,d=b[0].src.split("/"),e=d.length-1,f=0;f<c;f++){d[e]=d[e].replace(/(.*?)_p\d+(\..*?)/,"$1_p"+f+"$2");var g=d.join("/");a.push(g)}else g=$("img").src,a.push(g);for(var l=document.createElement("a"),m=a.length,f=0;f<m;f++)(function(h){setTimeout(function(){var k=a[h];l.href=k;l.download=k.split("/").slice(-1)[0];l.click()},500*h)})(f);
@tuki0918
tuki0918 / view.txt
Created September 6, 2014 10:33
php XML -> json -> Pretty
{
"information": {
"time": "1409999243"
},
"item": {
"a": "111",
"b": "222",
"c": "333"
}
}
@tuki0918
tuki0918 / .gitmodules
Last active August 29, 2015 14:08
CakePHP Settings
[submodule "app/Plugin/DebugKit"]
path = app/Plugin/DebugKit
url = https://github.com/cakephp/debug_kit.git
[submodule "app/Plugin/Phpunit"]
path = app/Plugin/Phpunit
url = https://github.com/dereuromark/cakephp-phpunit
[submodule "app/Plugin/Migrations"]
path = app/Plugin/Migrations
url = https://github.com/CakeDC/migrations.git
@tuki0918
tuki0918 / Berksfile
Last active August 29, 2015 14:08
vagrant-berkshelf install Error ใพใ‚ใ‚Šใ€€ใ‚ใ‚“ใพใ‚Š่ฆšใˆใฆใ„ใชใ„ใ‘ใฉใ€ใ“ใฎใธใ‚“ๆ€ชใ—ใ„
source 'https://supermarket.getchef.com'
cookbook 'apt'
@tuki0918
tuki0918 / get_user_id.php
Last active August 29, 2015 14:10
search for twitter user_id | reference: http://stabucky.com/wp/archives/2188
<?php
$a = array(0,1,2,3,4,5,6,7,8,9);
$b = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
$c = array('_');
$x = array_merge($a,$b,$c);
function userId($arr, $length = 4){
$max = count($arr);
if ($max < $length) {
@tuki0918
tuki0918 / td-agent.conf
Created November 24, 2014 13:58
Fluentd: apache.log
<source>
type tail
format apache
path /var/log/httpd/access_log
pos_file /var/log/td-agent/access_log.pos
tag apache.log
</source>
<match apache.log>
type elasticsearch
@tuki0918
tuki0918 / td-agent.conf
Created November 24, 2014 13:59
Fluentd: php_errors_log
<source>
type tail
format /^\[(?<time>[^\]]*)\] (?<message>.*)$/
path /var/log/php_errors.log
pos_file /var/log/td-agent/php_errors_log.pos
tag php.errors_log
</source>
<match php.errors_log>
type elasticsearch
@tuki0918
tuki0918 / td-agent.conf
Created November 24, 2014 14:36
Fluentd: apache.log | fluent-plugin-geoip
<source>
type tail
format apache
path /var/log/httpd/access_log
pos_file /var/log/td-agent/access_log.pos
tag geo.apache.log
</source>
<match geo.apache.log>
type geoip