-
-
Save patriciomg/3f329d5875174de96bcc21a6185cba01 to your computer and use it in GitHub Desktop.
Copies SequelPro results as a textile table to use it in Redmine or other textile-supported systems. To use, just copy it into your SequelPro Bundle Editor.
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/php | |
<?php | |
$in = fopen('php://stdin', 'r'); | |
$result=array(); | |
$format='_.'; | |
while($line=fgetcsv($in, 0, "\t")) { | |
$result[]='|'.$format.implode('|'.$format, $line).'|'; | |
$format=''; | |
} | |
fclose($in); | |
$cmd='echo '.escapeshellarg(implode("\n", $result)).' | __CF_USER_TEXT_ENCODING='.posix_getuid().':0x8000100:0x8000100 pbcopy'; | |
shell_exec($cmd); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment