Skip to content

Instantly share code, notes, and snippets.

View chronon's full-sized avatar

Gregory Gaskill chronon

  • @loadsys & chronon
  • Pisgah Forest, NC USA
View GitHub Profile
#!/usr/local/bin/php
<?php
$base = $_SERVER['HOME'].'/Library/Application Support/TextMate/Bundles/CakePHP.tmbundle/Snippets/';
foreach (glob($base.'*.tmSnippet') as $file) {
$xmlString = file_get_contents($file);
$xml = new SimpleXMLElement($xmlString);
$trigger = 'snippet '.$xml->dict->string[3];
$snip = $xml->dict->string[0];
$snip = str_replace(array('\\', '$0'),'',$snip);