A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer
- Composer Related
- Frameworks
- Micro Frameworks
openssl genrsa -out CAroot.key 2048 | |
openssl req -new -key CAroot.key -out CAroot.csr # CN should be different from the certificates below | |
openssl req -x509 -days 1825 -key CAroot.key -in CAroot.csr -out CAroot.crt | |
cat CAroot.crt CAroot.key > CAroot.pem | |
openssl genrsa -out mongod.key 2048 | |
openssl req -new -key mongod.key -out mongod.csr | |
openssl x509 -req -days 1825 -in mongod.csr -CA CAroot.pem -CAkey CAroot.key -CAcreateserial -out mongod.crt | |
cat mongod.crt mongod.key > mongod.pem |
/* | |
Question: Given a set of golf clubs with max and min distance they can shoot being | |
170 -190 | |
120-150 | |
60-90 | |
20-50 | |
1-10 | |
If given a distance to reach, find which clubs should be used to reach the given distance in an optimal way. |
function bodyBuilder($program_name,$reason,$source,$lookupField,$input, $id,$aic){ | |
$body = array(); | |
if (isset($program_name)){ | |
$body['programName'] = $program_name; | |
} | |
if (isset($reason)){ | |
$body['reason'] = $reason; | |
} | |
if (isset($source)){ | |
$body['source'] = $source; |
define ("MKTO_HOST", "**Your Marketo host**"); | |
define ("MKTO_CID", "**Your Marketo Client ID"); | |
define ("MKTO_CS","**Your Marketo Client Seccret"); | |
//generate token | |
function generate_token(){ | |
$ch = curl_init(MKTO_HOST . "/identity/oauth/token?grant_type=client_credentials&client_id=" . MKTO_CID . "&client_secret=" . MKTO_CS); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json',)); | |
$response = json_decode(curl_exec($ch)); |
<?php | |
//////////////////////// | |
# COLUMN EXAMPLES | |
//////////////////////// | |
//////////////////////// | |
# Add Column (after) | |
//////////////////////// | |
global $wpdb; |
<?php | |
function advanced_asyc_scripts($url) { | |
if ( strpos( $url, '#asyncload') === false ) { | |
return $url; | |
} else if ( is_admin() ) { | |
return str_replace( '#asyncload', '', $url ); | |
} else { | |
return str_replace( '#asyncload', '', $url )."' async='async' defer='defer"; | |
} | |
} |
Getting started:
Related tutorials:
<?php | |
$id = 75482; | |
$password = '3A90E5J0f6OUIfqN1Qu59gYrjDgDblfL'; | |
$card = '4627081718568608'; | |
$ssl_verify = TRUE; | |
$data = <<<XML | |
<oper>cmt</oper> | |
<wait>0</wait> | |
<test>0</test> |