Skip to content

Instantly share code, notes, and snippets.

View quantumJLBass's full-sized avatar

Quantum quantumJLBass

View GitHub Profile
@quantumJLBass
quantumJLBass / gist:6858006
Last active December 24, 2015 20:29
General php snippets -- side notes, you can test things or use as scratch paper, this php code testing site http://sandbox.onlinephpfunctions.com/

Quick copy past list

####pull from editor to for quickkeying####

regex string lowwer

$str='<taxonomy alias="Abnormal dreams" name="Abnormal dreams" taxonomy_type="adverse_events" content=""/>';

$text = preg_replace_callback('/alias="(.*?)"/im',"toLower",$str);
echo $text;
function toLower($matches){
@quantumJLBass
quantumJLBass / bash.md
Last active December 23, 2015 04:39
snippets for a command line bash.

General Bash snips

Test internet connectivity

#check to see if there is network connection
has_network(){
    # Capture a basic ping result to Google's primary DNS server to determine if
    # outside access is available to us. If this does not reply after 2 attempts,
    # we try one of Level3's DNS servers as well. If neither of these IPs replies to
    # a ping, then we'll skip a few things further in provisioning rather than

Magento Code Snippets