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
<?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 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
/* 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 | |
// 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
#!/bin/sh | |
# jm3.net | |
# uninstall the 162 non-English fonts that Apple installs that clog up Photoshop's font menu. | |
# ======================== | |
## RUN AT YOUR OWN RISK ## | |
# ======================== | |
# if this formats your hard drive or deletes your fonts or changes the sex | |
# of your dog, I'm super sorry, but there's nothing I can do. |
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
# In Simplify3D go to: | |
# - Edit Process Settings -> Scripts | |
# At the very bottom there is a box titled "Post Processing" | |
# Add the following command line to the box titled "Addidional Terminal Commands for Post Processing" | |
curl -k -H "X-Api-Key: 1111111222222233333444455555" -F "select=false" -F "print=false" -F "file=@[output_filepath]" "http://octopi.local/api/files/local" |