Skip to content

Instantly share code, notes, and snippets.

@jakob-stoeck
Created October 29, 2013 17:52
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save jakob-stoeck/7219471 to your computer and use it in GitHub Desktop.
Save jakob-stoeck/7219471 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.
#!/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);
@daverogers
Copy link

Thanks, this was a good starting point for a similar format I needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment