Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View miukoba's full-sized avatar
🏠
Working from home

Miu Kobayashi miukoba

🏠
Working from home
View GitHub Profile
@miukoba
miukoba / README.md
Last active November 21, 2021 15:08
my mouse-dictionary settings
@miukoba
miukoba / gist:cf07177987c2bef33d567c64ea3eef17
Last active May 29, 2019 09:25
Slackに全てのひらがなをemojiとして追加する手順

感謝

  • いらすとやの素材を使用させていただきました

手順

ファイル名の一括置換に mac の homebrew で入る renaem コマンドを使用しているが、他の方法でも良い

  1. Chromeで http://www.irasutoya.com/2013/02/50.html を開く (他のブラウザでも同じような感じに保存できると思うけど試してません)
  2. 「ページを別名で保存」 - 「ウェブページ、完全」 で保存すると、htmlファイルと、画像等が入ったディレクトリが出来る

マージ済みのリモートブランチを全て削除

git branch -r --merged master | grep -v -e master -e develop | sed -e 's% *origin/%%' | xargs -I% git push --delete origin %
  1. remote の master に merge済み の branch をすべて表示して
  2. master と develop は消えてほしくないので除外して
  3. origin/ を削除して
  4. xargs (-I% % で ブランチ名を渡しつつ、全て削除する)
@miukoba
miukoba / xhprof_setting.php
Created December 12, 2013 08:37
xhprof の設定
<?php
// フロントコントローラとかに仕込む
xhprof_enable();
// 処理
$xhprof_data = xhprof_disable();
@miukoba
miukoba / performance.php
Created December 12, 2013 02:35
PHPのパフォーマンス簡易測定
<?php
$startTime = microtime(true);
// 処理
//for ($i = 0; $i < 10000; ++$i)
//{
//}
echo PHP_EOL . PHP_EOL;
echo '>>> result >>>>>>>>>>>>>>>>>>>>>>>>>>>' . PHP_EOL;
echo "process time: " . (microtime(true) - $startTime) . ' ms' . PHP_EOL;
@miukoba
miukoba / gist:7922295
Created December 12, 2013 02:23
Live Template for PhpStorm

登録の流れ

  • Abbereviation, Description, Template text を入力
  • Edit variables をクリックして、順番を変更
  • Reformat according to style にチェック
  • Defineをクリックして、PHPを選択

PHP

@miukoba
miukoba / gist:4043586
Created November 9, 2012 03:51
inject jQuery
javascript:(function(){javascript:(function(){var src_url = 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js';var notice_style ='position:fixed;'+'z-index:10000;'+'top:0;'+'left:0;'+'background-color:red;'+'color:white;'+'padding:10px;'+'margin:10px;'+'font:bold 16px sun-serif;';var s=document.createElement('script');s.setAttribute('src',src_url);document.getElementsByTagName('body')[0].appendChild(s);var id = window.setInterval(function(){if (window['jQuery'] &&window['jQuery']['fn'] &&window['jQuery']['fn']['offset']){window.clearInterval(id);$('<div style=\''+notice_style+'\'><p>jQuery '+ jQuery.fn.jquery+' Loaded!<p></div>').appendTo('body').animate({opacity:1},2000).animate({opacity:'hide'},500,function(){jQuery(this).remove();});}},100);})();})();
@miukoba
miukoba / bookmarklet
Created October 10, 2012 09:40
全inputに文字列を入力するテスト用のブックマークレット
javascript:(function(){var str=prompt('テスト文字列を入力して下さい。',"<script>alert('XSS');</script>");if(str!=""&&str!=null){var text=document.getElementsByTagName("input");for(var i=0,l=text.length;i<l;i++){if(text[i].type=='text'){text[i].value=str}}var textarea=document.getElementsByTagName("textarea");for(var i=0,l=textarea.length;i<l;i++){textarea[i].value=str}}}())
@miukoba
miukoba / ur_scraper.coffee
Created September 16, 2012 07:41 — forked from hosokawa0825/ur_scraper.coffee
URスクレイピングコード
casper = require('casper').create
verbose: true
logLevel: "debug"
clientScripts: ["../lib/jquery-1.7.1.min.js"]
pageSettings: [loadImages:false]
onError: ->
@echo arguments
#for i in [1..6]
@miukoba
miukoba / gist:2526160
Created April 29, 2012 02:49
Markdown template (cheat sheet)

Headers - 見出し

This is an H1

This is an H1

This is an H2

This is an H2

This is an H3