Skip to content

Instantly share code, notes, and snippets.

View justinwhall's full-sized avatar

Justin W Hall justinwhall

View GitHub Profile
@justinwhall
justinwhall / promise-async-await.js
Last active January 10, 2020 03:32
Make multiple fetch request with Promise.all & async await.
const userUrls = [
'https://api.github.com/users/justinwhall',
'https://api.github.com/users/codeprokid',
'https://api.github.com/users/jasonbahl',
];
/**
* OPTION (A) Make multiple fetch request with Prmoise.all & async await.
*/
@justinwhall
justinwhall / .travis.yaml
Last active February 11, 2018 15:56
Pantheon TravisCI
# Encrypted travis ENV vars
# $PANTHEON_UUID === Pantheon UUID
# $GIT_EMAIL === Email associated to panthoeon user (and SSH key)
sudo: false
env:
global:
- PANTHEON_SITE='pantheon-site-name'
@justinwhall
justinwhall / remove-emojis.php
Last active January 4, 2018 15:58
Disable WordPress Emoji's
<?php
/**
* No thanks on emojis.
*
* @return void
*/
function disable_wp_emojicons() {
// all actions related to emojis.
remove_action( 'admin_print_styles', 'print_emoji_styles' );
<?php
/**
* Enqueue scripts and styles.
*/
function justinwhallv5_scripts() {
// Remove jQuery from the public side
if ( ! is_admin() ) {
wp_deregister_script( 'jquery' );
}
@justinwhall
justinwhall / gulpfile.js
Last active January 5, 2018 18:12
Simple Gulp dev/build
var gulp = require( 'gulp' );
var gulpif = require( 'gulp-if' );
var browserSync = require( 'browser-sync' ).create();
var babel = require( 'gulp-babel' );
var sass = require( 'gulp-sass' );
var sourcemaps = require( 'gulp-sourcemaps' );
var autoprefixer = require( 'gulp-autoprefixer' );
var concat = require( 'gulp-concat' );
var cssnano = require( 'gulp-cssnano' );
var uglify = require( 'gulp-uglify' );
START=$(date +%s)
# do a bunch of backup related things
END=$(date +%s)
runtime=$(($END-$START))
echo "databases.backups.$db_prefix.full $runtime `date +%s`" | nc -w 1 $graphite_url 2003
xtrabackup: error: log block numbers mismatch:
xtrabackup: error: expected log block no. 243782669, but got no. 245879813 from the log file.
xtrabackup: error: it looks like InnoDB log has wrapped around before xtrabackup could process all records due to either log c
opying being too slow, or log files being too small.
xtrabackup: Error: xtrabackup_copy_logfile() failed.
/usr/bin/gpg2 –decrypt $backupfile.gpg > backup_file.xbs
innobackupex $backup_path 2>>$log_file | pigz | /usr/local/bin/gpg2 –no-default-keyring –keyring /var/lib/mysql/backup_keyring.gpg –trust-model always –encrypt –digest-algo sha512 –cipher-algo aes256 –compress-level 0 –recipient REDACTED –recipient REDACTED | ssh $remote_user@$remote_server “cat > $remote_path/$date_path/FS_$backup_file” 2>>$local_err
@justinwhall
justinwhall / .csscomb.json
Created August 3, 2017 19:26
BEM .csscomb.json
{
"always-semicolon": true,
"block-indent": 2,
"color-case": "lower",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"exclude": ["node_modules/**"],
"leading-zero": true,
"lines-between-rulesets": 1,