This file contains hidden or 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
#!/bin/bash | |
FF=`ps aux | grep firefox-bin | wc -l` | |
if [ "$FF" == 1 ]; then | |
env DISPLAY=:0. zenity --info --text "I run Firefox" && firefox | |
else | |
env DISPLAY=:0. zenity --info --text "Firefox is running" | |
fi |
This file contains hidden or 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
mm hh * * * export DISPLAY=:0 && firefox-bin > /dev/null 2>&1 |
This file contains hidden or 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 | |
/** | |
* is assoc array | |
* | |
* @see http://jp.php.net/manual/ja/function.is-array.php | |
* @param array $a | |
* @access public | |
* @return bool | |
*/ |
This file contains hidden or 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
/** | |
* sprintf use array | |
* | |
* @see http://jp.php.net/manual/ja/function.printf.php | |
* @param string $format | |
* @param array $arr | |
* @access public | |
* @return string | |
*/ | |
function sprintf_array( $format, $arr ) { |
This file contains hidden or 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 | |
/** | |
* htmlescape but $tags | |
* | |
* @see http://jp.php.net/manual/ja/function.htmlspecialchars.php | |
* @param string $str | |
* @param string $tags delimiter "|". i.e. 'a|div|span' | |
* @param string $quote_style | |
* @param string $l_deli '##{##' |
This file contains hidden or 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
function mb_trim( $str ) { | |
return mb_ereg_replace( | |
'^[[:space:]]*([\s\S]*?)[[:space:]]*$', '\1', $str ); | |
} |
This file contains hidden or 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 confirm plug-in | |
* | |
* @see http://blog.smartnetwork.co.jp/staff/jquery-confirm-plugin | |
* | |
* usage: | |
* <form id="hoge" method="post"> | |
* <input type="submit" name="hoge" value="ダイアログなし"/> | |
* <input type="submit" name="hoge" title="ほんとに送信?" value="ダイアログあり"/> | |
* </form> |
This file contains hidden or 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
" Language: Colored CSS Color Preview | |
" Maintainer: Niklas Hofer <[email protected]> | |
" URL: svn://lanpartei.de/vimrc/after/syntax/css.vim | |
" Last Change: 2008 Feb 12 | |
" Licence: No Warranties. Do whatever you want with this. But please tell me! | |
" Version: 0.6 | |
function! s:FGforBG(bg) | |
" takes a 6hex color code and returns a matching color that is visible | |
let pure = substitute(a:bg,'^#','','') |
This file contains hidden or 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
// @see http://search.cpan.org/~mschwern/Test-Simple/lib/Test/More.pm | |
function test (num) { | |
if ( num > 0 ) { | |
console.log('1..' + num); | |
} | |
} | |
function is (got, expected, message) { | |
var str = ''; | |
if (got !== expected) { | |
str += 'not '; |
This file contains hidden or 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://hail2u.net/blog/software/convert-hex-color-to-functional-color-with-vim.html | |
command! -range=% HexToFunc :silent!<line1>,<line2>s/#¥([0-9A-F]¥{3,6}¥)/¥=HexToFunc(submatch(1))/gi | |
function! HexToFunc(hex) | |
if strlen( a:hex ) == 6 | |
let color = matchlist(a:hex, '¥([0-9A-F]¥{2¥}¥)¥([0-9A-F]¥{2¥}¥)¥([0-9A-F]¥{2¥}¥)') | |
return s:ToRgbFunc(color[1], color[2], color[3]) | |
endif | |
let color = split(a:hex, '¥zs') | |
return s:ToRgbFunc(repeat(color[0], 2), repeat(color[1], 2), repeat(color[2], 2)) |
OlderNewer