This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 自分の担当しているチケットを表示する Window > User Scriptで貼りつける | |
* | |
* @return void | |
*/ | |
function getTicketCount(){ | |
new Ajax.Request("http://tech.hametuha.org/issues.xml", { | |
method: "get", | |
parameters: { | |
key: "Here_comes_your_api_key", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Macportsでnmapをインストールすること | |
nmap -sT 192.168.0.0-255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://hatomugi.sakura.ne.jp/forum/topic.php?id=76 | |
#メールキュー確認 | |
mailq | |
#メールキューのIDで中身を見る | |
sudo postcat -q [キューID] | nkf -m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/local/bin/php | |
<?php | |
// 1行目のシバンは環境に合わせて書き換えてください | |
// `which php` とターミナルで打つと、パスがわかります。 | |
$file = './readme.md'; | |
if( !file_exists($file) ){ | |
die("[Error] 現在のディレクトリにreadme.mdが存在しません".PHP_EOL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WordPressで全文検索を試みる | |
* | |
* initフックなどでインスタンス化してください。 | |
* あんまり遅いタイミングだとエラーを吐きます。 | |
* Singleton実装です。 | |
* | |
* <code> | |
* // functions.phpなどに記載 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($){ | |
// ショートコード挿入 | |
$('.button-shortcode').click(function(e){ | |
e.preventDefault(); | |
// ex. ショートコードの値 | |
var shortcode = $(this).prev('input').val(), | |
mce = window.parent.tinyMCE; | |
if( mce.activeEditor && !(mce.activeEditor.isHidden()) ){ | |
// TinyMCEがオープンならそれを使う | |
window.parent.tinyMCE.activeEditor.execCommand( 'mceInsertContent', false, shortCode ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* catchブロックの中でエラーを投げてみる | |
* | |
* php try-catch.php 1000と入力すると、 | |
* Uncaught exceptionが発生。したがって、こういうことをやりたい場合は | |
* 入れ子にしないとダメ。 | |
* 結果的に、例外の種類が増えると入れ子がどんどん深くなっていく | |
* 5.5ならfinally があるので、もうちょっとすっきりできる | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file = explode("\n", file_get_contents('./lsf.txt')); | |
$variables = []; | |
$sass = []; | |
foreach($file as $row){ | |
list($title, $aliases, $unicode) = array_map('trim', explode("\t", trim($row))); | |
$title = 'lsf-'.$title; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The MeCab PHP extension | |
* | |
* Copyright (c) 2006-2012 Ryusuke SEKIYAMA. All rights reserved. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a | |
* copy of this software and associated documentation files (the "Software"), | |
* to deal in the Software without restriction, including without limitation | |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |