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
| groupZeros = function (ar) { | |
| for(var i = ar.length - 1; i > 0; i--) { | |
| if(ar[i] == 0) { | |
| for(var z = 0; z < i - 1; z++) { | |
| if(ar[z] == 0) { | |
| ar.splice(i, 1); | |
| ar.splice(z, 0, 0); | |
| z = i; | |
| } | |
| } |
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
| lasterror() { | |
| logpath=/usr/local/www-conf/logs/$1-phplog; | |
| error=(${(f)$(awk -F: '/PHP Fatal error|\[error\]/ { lines[last] = NR } END { print lines[last] }' $logpath)}); | |
| [[ -n $error ]] && tail -n +$error $logpath | |
| } |
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 | |
| class Github_Packager { | |
| private static $api_endpoint = 'http://github.com/api/v2/json/'; | |
| private static $temp_path = './temp/'; | |
| public static function list_branches ( $addon_name, $with_commits = false ) { | |
| $url = self::$api_endpoint . 'repos/show/habari-extras/' . $addon_name . '/branches'; |