Skip to content

Instantly share code, notes, and snippets.

<?php
namespace DataRenovationBundle\Util;
use ArrayObject;
/**
* DataRenovationBundle\Utils\ArrayUtil
*
* 配列に関わるユーティリティ
*/
"" options {{{1 ------------------------------------------------------------------------------------
" indent
set autoindent
set expandtab
set shiftwidth=4
set smarttab
set tabstop=4
" search
@yosugi
yosugi / with-subcommand.zsh
Last active September 19, 2019 01:57
Add custom subcommand into any command
#!/bin/zsh
#
# with-subcommand.zsh
#
# Description:
#
# Add custom subcomand into any command
#
# Installation:
#
@yosugi
yosugi / tmux-multi-ssh
Created June 21, 2016 05:44 — forked from nikushi/tmux-multi-ssh
tmuxで複数にsshしてコマンドシンクするスクリプト by @mikeda
#!/bin/bash
#
# http://tech.naviplus.co.jp/2014/01/09/tmuxで複数サーバの同時オペレーション/
#
if [ -n "$SESSION_NAME" ];then
session=$SESSION_NAME
else
session=multi-ssh-`date +%s`
fi
@yosugi
yosugi / git-diff-test
Created October 4, 2015 06:06
git-diff-test
#!/usr/bin/env perl
use strict;
use warnings;
sub checkPhp {
my ($file) = @_;
return if ($file !~ /\.php$/);
<h1>ページのタイトルと URL をコピーするブックマークレット</h1>
<a href=
"javascript:void(window.clipboardData.setData('text', '[' + document.title+']('+document.location + ')'))">
URLコピー</a>
<a href=
"javascript:window.prompt('','['+ document.title +']('+ location.href + ')');void(0);">
URLコピーMarkdown</a>
  • ssh
    • host1 - (FW) - host2 - host3
      • host2, 3 は同じネットワークにあるが host1 からは host2 しか見えない
    • host1:2034 に host3 の22をつなげる(host2 を経由)。 host1 で以下を実行する
      • ssh -i <キーのパス> -f -o ServerAliveInterval=60 -g -L 2034(ローカルのポート):host3:22 <host2 のユーザ>@host2
      • mysql にも使えます
      • ssh -N -i <キーのパス> -f -o ServerAliveInterval=60 -g -L 2306:host3:3306 <host2 のユーザ>@host2
    • host3 から host1 にログインする host1 の .ssh/config Host 2ndProxy Hostname Host3
MODx.on('ready', function() {
var toolBar = Ext.getCmp('modx-action-buttons');
toolBar.insertButton(3, buttons);
toolBar.addButton(buttons);
toolBar.doLayout();
}
@yosugi
yosugi / git.md
Last active December 14, 2015 06:38
個人的逆引き git
  • stash で untracked なファイルを save する
    • git stash save --include-untracked
    • git stash save -u
  • stash にメッセージをつける
    • git stash save "つけたい名前"
  • 一つ前にいたブランチに移動
    • git checkout -
  • ログを発掘する
    • git reflog show develop
  • 新規ブランチ作成
@yosugi
yosugi / withOutputBuffer.php
Created February 22, 2013 14:42
with output buffer
function withOutputBuffer()
{
$args = func_get_args();
$func = array_shift($args);
ob_start();
$ret = call_user_func_array($func, $args);
$out = ob_get_contents();
ob_end_clean();