git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
CREATE TRIGGER before_insert_news_item | |
BEFORE INSERT ON news | |
FOR EACH ROW | |
SET new.created = now(); |
function mailgun($message = null, $to = null) | |
{ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); | |
curl_setopt($ch, CURLOPT_USERPWD, 'api:key-abc'); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
$plain = strip_tags($message); |
#!/bin/bash | |
# | |
# Presume suspicious_euclid is the id of the Docker container, from docker ps | |
# Requirements: nsenter - https://blog.codecentric.de/en/2014/07/enter-docker-container/ | |
# Suggestion: move to /usr/local/bin and remove the sh extension, then you just run dockerssh suspicious_euclid | |
# Usage: sudo ./dockerssh.sh suspicious_euclid | |
if [ -z "$1" ]; then | |
echo "Please pass a docker container id or name to this script." | |
exit; |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
location / { | |
if ( $remote_addr ~* 192.133.125.0/24 ) { | |
limit_rate 3k; | |
} | |
if ( $remote_addr ~* 165.135.0.0/16 ) { | |
limit_rate 3k; | |
} | |
<?php | |
/** | |
* Presumes you've installed Composer in the directory according to http://getcomposer.org/doc/01-basic-usage.md | |
*/ | |
require_once(APP . 'Vendor' . DS. 'LibPhoneNumber' . DS . 'src' . DS . 'libphonenumber'. DS ."PhoneNumberUtil.php"); | |
require_once(APP . 'Vendor' . DS. 'LibPhoneNumber' . DS . 'src' . DS . 'libphonenumber'. DS ."CountryCodeToRegionCodeMap.php"); | |
require_once(APP . 'Vendor' . DS. 'LibPhoneNumber' . DS . 'src' . DS . 'libphonenumber'. DS ."PhoneNumber.php"); | |
require_once(APP . 'Vendor' . DS. 'LibPhoneNumber' . DS . 'src' . DS . 'libphonenumber'. DS ."data" . DS . "PhoneNumberMetadata_GB.php"); | |
require_once(APP . 'Vendor' . DS. 'LibPhoneNumber' . DS . 'src' . DS . 'libphonenumber'. DS ."PhoneMetadata.php"); | |
require_once(APP . 'Vendor' . DS. 'LibPhoneNumber' . DS . 'src' . DS . 'libphonenumber'. DS ."PhoneNumberDesc.php"); |
<?php | |
/* | |
This is a fully working Class to upload, list and delete items from an Amazon S3 bucket. | |
Add your Config::write/Config::read variables as appropriate. Presumed region: US_EAST_1 | |
Download the most recent cacert.pem from http://curl.haxx.se/docs/caextract.html | |
To install on a new machine, create a file called composer.json and add this: | |
{ | |
"require": { | |
"aws/aws-sdk-php": "*" | |
} |