sudo usermod -a -G nginx ec2-user &&
exit
String.prototype.getInitials = function(glue){ | |
if (typeof glue == "undefined") { | |
var glue = true; | |
} | |
var initials = this.replace(/[^a-zA-Z- ]/g, "").match(/\b\w/g); | |
if (glue) { | |
return initials.join(''); | |
} |
#!/bin/bash | |
# Stop all containers | |
containers=`docker ps -a -q` | |
if [ -n "$containers" ] ; then | |
docker stop $containers | |
fi | |
# Delete all containers | |
containers=`docker ps -a -q` | |
if [ -n "$containers" ]; then | |
docker rm -f -v $containers |
<?php | |
/****** | |
Parallelize downloads across hostnames for WordPress. | |
Useful to boost static resources load speed on websites. | |
Recommended by GTmetrix, Pingdom, Google Speed Insights, and others. | |
See full post > https://medium.com/p/32e9dc2fec0c | |
In order to work properly, all subdomains/hostnames MUST have the same structure/path. Ex: | |
http://mydomain.com/wp-content/uploads/2015/11/myimage.jpg |
/** | |
* This function loops over cart items, and moves any item with shipping class 'special-class' into a new package. | |
* The new package in this example only takes flat rate shipping. | |
*/ | |
function split_special_shipping_class_items( $packages ) { | |
$found_item = false; | |
$special_class = 'special-class'; // edit this with the slug of your shippig class | |
$new_package = current( $packages ); | |
$new_package['contents'] = array(); | |
$new_package['contents_cost'] = 0; |
var browserSync = require("browser-sync"); | |
var bs1 = browserSync.create("proxy1"); | |
var bs2 = browserSync.create("proxy2"); | |
bs1.init({ | |
proxy: "http://mylocal.dev", | |
port: 3010, | |
ui: { | |
port: 3011 |
sudo pip install awscli | |
aws configure | |
aws ses send-email \ | |
--from "john@gmail.com" \ | |
--destination "ToAddresses=mike@gmail.com" \ | |
--message "Subject={Data=from ses,Charset=utf8},Body={Text={Data=ses says hi,Charset=utf8},Html={Data=,Charset=utf8}}" |
// License: MIT, feel free to use it! | |
const Intercom = require('intercom-client'); | |
const appId = 'APP_ID' | |
const apiKey = 'APP_KEY' | |
const client = new Intercom.Client(appId, apiKey); | |
const async = require('async-q') | |
//REF: https://developers.intercom.com/reference#iterating-over-all-users | |
//WARNING: you can only have one scroll working at once. you need to wait for that scroll to clear to try again |
These are generic npm scripts that you can copy & paste into your package.json
file as-is and get access to convinience scripts to manage your Docker images all in one place.
npm i -g mrm-task-npm-docker
npx mrm npm-docker
Here's the code repository https://github.com/expertly-simple/mrm-task-npm-docker
<?php | |
/** | |
* Run a WP-CLI command via an authorized HTTP POST webhook. | |
* | |
* curl -X POST https://mysite.com/webhook-wp-cli.php \ | |
* -H 'Content-Type: application/json' \ | |
* -H 'X-Authorization: Bearer MY_SUPER_SECRET_KEY_HERE' \ | |
* -d '[ ["theme", "install"], ["https://downloads.wordpress.org/theme/go.zip"], ["force"], {"user": 1} ]' | |
* |