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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
# skip existent files | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteRule index.php - [QSA,L,C] | |
RewriteRule .* - [QSA,L] | |
# deny access php files |
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
#!/usr/bin/env php | |
<?php | |
while (false !== $line = fgets(STDIN)) { | |
print_r(parse($line)); | |
} | |
// 68 sec | |
function parse($line) | |
{ |
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 | |
/** | |
* PHP CLI Colors – PHP Class Command Line Colors (bash) | |
* | |
* $str = "This is an example "; | |
* | |
* foreach (ColorCLI::$foregroundColors as $fg => $fgCode) { | |
* echo ColorCLI::$fg($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
<?php | |
function run($path) | |
{ | |
$xml = simplexml_load_file($path); | |
$project = $xml->testsuite; | |
echo sprintf("total: %s msec", formatMsec($project['time'])) . PHP_EOL; | |
foreach ($project->testsuite as $testsuite) { |
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 | |
function run($path) | |
{ | |
$xml = simplexml_load_file($path); | |
foreach ($xml->file as $file) { | |
echo sprintf("file: %s", $file['name']) . PHP_EOL; | |
foreach ($file->violation as $violation) { | |
echo " " . printMessage($violation) . PHP_EOL; |
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 | |
function run($path) | |
{ | |
$xml = simplexml_load_file($path); | |
foreach ($xml->file as $file) { | |
echo sprintf("file: %s", $file['name']) . PHP_EOL; | |
foreach ($file->error as $violation) { | |
echo " " . printMessage($violation) . PHP_EOL; |
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 | |
namespace Satooshi; | |
/** | |
* Short description. | |
* | |
* Long description. | |
*/ | |
class Test | |
{ |
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 | |
$file = './tumblr.xml'; | |
$xml = simplexml_load_file($file); | |
$posts = $xml->posts; | |
$root = "./_posts"; | |
if (!is_dir($root)) { | |
mkdir($root); | |
} |
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/sh | |
cmd_pandoc="pandoc -f html -t markdown body.html -o body.md" | |
posts=`ls _posts` | |
root_dir=`pwd` | |
for post in ${posts} | |
do | |
post_dir="_posts/${post}" | |
echo ${post_dir} |
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
cat categories | awk '{count[$0]++}END{for(i in count)print count[i], i}' | sort -nr |
OlderNewer