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 | |
| // Remove duplicates from a php array | |
| $array = array_unique($array, SORT_REGULAR); |
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
| /* I use Stylish (a chome addin) to set these styles | |
| * URLs on the domain workflowy | |
| */ | |
| .next-row { | |
| border: 2px solid #46A546 !important; | |
| border-top-left-radius:0.5em; | |
| background-color: #CCFFCC !important; | |
| } |
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
| /* I use Stylish (a chome addin) to set these styles | |
| * URLs on the domain workflowy | |
| */ | |
| .next-row { | |
| border: 2px solid #46A546 !important; | |
| border-top-left-radius:0.5em; | |
| background-color: #CCFFCC !important; | |
| } |
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 generateCsv($data, $delimiter = ',', $enclosure = '"') { | |
| $handle = fopen('php://temp', 'r+'); | |
| foreach ($data as $line) { | |
| fputcsv($handle, $line, $delimiter, $enclosure); | |
| } | |
| rewind($handle); | |
| while (!feof($handle)) { | |
| $contents .= fread($handle, 8192); | |
| } |
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 | |
| $expected=array('module','act','gal_id','page_id','view','reply','post_id'); | |
| foreach($expected as $key){ | |
| if(!empty($_GET[$key])){ | |
| ${key}=$_GET[$key]; | |
| } else{ | |
| ${key}=NULL; | |
| } | |
| } | |
| ?> |
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 extract_emails_from($string){ | |
| preg_match_all("/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i", $string, $matches); | |
| return $matches[0]; | |
| } | |
| // Example useage | |
| $text = "blah blah blah [email protected] blah blah blah [email protected]"; |
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
| /** | |
| * For modern browsers | |
| * 1. The space content is one way to avoid an Opera bug when the | |
| * contenteditable attribute is included anywhere else in the document. | |
| * Otherwise it causes space to appear at the top and bottom of elements | |
| * that are clearfixed. | |
| * 2. The use of `table` rather than `block` is only necessary if using | |
| * `:before` to contain the top-margins of child elements. | |
| */ | |
| .cf:before, |
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
| function LightenDarkenColor(col, amt) { | |
| var usePound = false; | |
| if (col[0] == "#") { | |
| col = col.slice(1); | |
| usePound = true; | |
| } | |
| var num = parseInt(col,16); |