Skip to content

Instantly share code, notes, and snippets.

View markingman's full-sized avatar

Mark Ingman markingman

View GitHub Profile
/*
Show CSS breakpoint labels for various screen widths
*/
body:after
{
content: 'default';
position: fixed;
bottom: 0;
left: 0;
#!/usr/bin/php
<?php
/**
* BBEdit SQL format text filter
* For a file with SQL query, send page contents to SQL format API and repopulate file with results
*/
$str = file_get_contents('php://stdin');
$str = str_replace(array("\n", "\r", "\t"), ' ', $str);
$str = preg_replace('~ +~', ' ', $str);
@markingman
markingman / gist:236d8b75bac861361772
Last active August 29, 2015 14:01
BBEdit Text Filter: reset PHP links
#!/usr/bin/php
<?php
/**
* BBEdit reset PHP links text filter
* When editing attributes for <a> tag with PHP link (<a href="<?=FOO?>">), reset '&lt;?=...?&gt;' to '<?=...?>'
*/
while($l = fgets(STDIN))
{
$l = preg_replace('~ (action|href)="&lt;\?=(\$*[^\?]+)\?&gt;"~',' \1="<?=\2?>"',$l);
echo $l;