Skip to content

Instantly share code, notes, and snippets.

View emaildano's full-sized avatar
🏄‍♀️
Surfing the information superhighway

Dano emaildano

🏄‍♀️
Surfing the information superhighway
  • Philadelphia, PA
View GitHub Profile
@marcus-at-localhost
marcus-at-localhost / alpine-js-fetch-data-on-x-init.markdown
Last active November 25, 2022 08:20
[Alpine.js fetch data on `x-init`] #js #alpinejs
@fjarrett
fjarrett / webhook-wp-cli.php
Last active May 10, 2022 15:25
Run a WP-CLI command via an authorized HTTP POST webhook
<?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} ]'
*
@duluca
duluca / npm-scripts-for-docker.md
Last active April 8, 2024 09:52
npm scripts for Docker

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.

How to Use

npm i -g mrm-task-npm-docker
npx mrm npm-docker

Contribute

Here's the code repository https://github.com/expertly-simple/mrm-task-npm-docker

@emaildano
emaildano / README.md
Last active June 6, 2017 08:06
AMIMOTO User Permissions

AMIMOTO User Permissions

Add ec2-user to nginx group

sudo usermod -a -G nginx ec2-user &&
exit

Update Owner & Permissions

@zthomas
zthomas / intercom-delete-old-users.js
Last active May 1, 2023 15:28
Script to delete and clear old users from intercom. Useful for lowering the monthly bill
// 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
@umrashrf
umrashrf / aws_ses.bash
Created July 26, 2016 19:05
Amazon AWS CLI - SES SEND EMAIL
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}}"
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
@mikejolley
mikejolley / functions.php
Last active May 17, 2021 13:51
WooCommerce - Split shipping class items into a new package and limit shipping methods
/**
* 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;
@leowebguy
leowebguy / parallelize.php
Last active August 31, 2020 15:28
Parallelize downloads across hostnames for WordPress. Useful to boost static resources load speed on websites. Recommended by GTmetrix, Pingdom, Google Speed Insights, and others.
<?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
@JeffBelback
JeffBelback / docker-destroy-all.sh
Last active December 12, 2023 17:47
Destroy all Docker Containers and Images
#!/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