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
/* | |
* Porting https://gist.github.com/demouth/1986726 | |
* | |
* Example | |
* ``` | |
* //Example 1 | |
* let c = new Color(); | |
* c.rgb(250,10,10).v(c.v() * 0.8); | |
* | |
* //Example 2 |
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
#!/bin/bash | |
#2つの引数の間の数値をランダムで返す | |
#第一引数の方がより小さな値を渡すこと | |
function rand() { | |
range=$(($1 - $2)) | |
ret=$((RANDOM % range + $1)) | |
echo $ret | |
} |
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
;(function(ns){ | |
/** | |
* mb_strwidth | |
* @param String | |
* @return int | |
* @see http://php.net/manual/ja/function.mb-strwidth.php | |
*/ | |
var mb_strwidth = function(str){ | |
var i=0,l=str.length,c='',length=0; | |
for(;i<l;i++){ |
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 | |
/** | |
* Color | |
* 色を表すクラス。 | |
* RGB・HSV変換できます。 | |
* | |
* @example | |
* Example 1: | |
* //RGBを10進数で個別に設定する。 | |
* $color = new Color(); |
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 | |
namespace WebSocket; | |
/** | |
* WebSocket Connection class | |
* | |
* @author Nico Kaiser <nico@kaiser.me> | |
* @author Simon Samtleben <web@lemmingzshadow.net> | |
*/ | |
class Connection |