Skip to content

Instantly share code, notes, and snippets.

View jeff-kilbride's full-sized avatar

Jeff Kilbride jeff-kilbride

  • Los Angeles, CA
View GitHub Profile
@jeff-kilbride
jeff-kilbride / filter-wp-uploads.php
Created March 28, 2018 01:26 — forked from kopiro/filter-wp-uploads.php
Filter wordpress uploads
<?php
add_filter('wp_get_attachment_url', function($url) {
if (getenv('USE_S3_UPLOADS')) {
$url = 'https://' . getenv('AWS_S3_BUCKET') . '.s3.amazonaws.com' . str_replace(WP_CONTENT_URL, '', $url);
}
return $url;
});
add_filter('wp_calculate_image_srcset', function($sources) {
@jeff-kilbride
jeff-kilbride / developer-console.log
Created November 17, 2017 21:21
Log of mocha-sidebar activity
/*******************************************************/
/* ADDED BLANK LINE TO AdminController.test.js FILE */
/*******************************************************/
13:08:06.020 console.ts:123 [Extension Host] notification: changes detected update will start in 3000 seconds
13:08:06.021 console.ts:123 [Extension Host] true
13:08:06.021 console.ts:123 [Extension Host] notification: ignore changes timeout active
13:08:07.191 console.ts:123 [Extension Host]% Object {uri: Object, fileName: "/Users/jeff/VSCode/api/src/test/api/controllers/AdminController.test.js", isUntitled: false, languageId: "javascript", version: 19…}
13:08:09.021 console.ts:123 [Extension Host] notification: timeout reached activating and set time out to active again
13:08:10.098 console.ts:123 [Extension Host]
@jeff-kilbride
jeff-kilbride / plugin-config.js
Created October 17, 2017 18:08
Plugin config file
'use strict';
module.exports = {
host: process.env.API_HOST,
keys: {
private: process.env.API_KEY
},
endpoints: [
['admin.alive', '/admin/alive'],
@jeff-kilbride
jeff-kilbride / plugin-index.js
Created October 17, 2017 18:04
Plugin index file
'use strict';
const HauteCouture = require('haute-couture'),
Config = require('./config');
module.exports = (server, options, next) => {
// Get the Confidence object from the server.app object.
const store = server.app.store;
@jeff-kilbride
jeff-kilbride / app.js
Created October 17, 2017 18:02
Server startup
'use strict';
const Confidence = require('confidence'),
Glue = require('glue'),
Config = require('./config');
const store = new Confidence.Store(Config),
manifest = store.get('/Glue', { env: process.env.NODE_ENV || 'local' });
@jeff-kilbride
jeff-kilbride / server-config.js
Created October 17, 2017 18:01
Server level glue / confidence config
'use strict';
module.exports = {
Glue: {
server: {
cache: {
name: 'redis',
engine: 'catbox-redis',
host: process.env.REDIS_HOST,
@jeff-kilbride
jeff-kilbride / syslog.txt
Created September 16, 2017 01:53
Goofys reboot syslog
Sep 10 05:15:01 ip-172-31-51-116 rsyslogd: [origin software="rsyslogd" swVersion="7.4.4" x-pid="831" x-info="http://www.rsyslog.com"] start
Sep 10 05:15:01 ip-172-31-51-116 rsyslogd-2307: warning: ~ action is deprecated, consider using the 'stop' statement instead [try http://www.rsyslog.com/e/2307 ]
Sep 10 05:15:01 ip-172-31-51-116 rsyslogd: rsyslogd's groupid changed to 104
Sep 10 05:15:01 ip-172-31-51-116 rsyslogd: rsyslogd's userid changed to 101
Sep 10 05:15:01 ip-172-31-51-116 kernel: [ 0.000000] Initializing cgroup subsys cpuset
Sep 10 05:15:01 ip-172-31-51-116 kernel: [ 0.000000] Initializing cgroup subsys cpu
Sep 10 05:15:01 ip-172-31-51-116 kernel: [ 0.000000] Initializing cgroup subsys cpuacct
Sep 10 05:15:01 ip-172-31-51-116 kernel: [ 0.000000] Linux version 3.13.0-129-generic (buildd@lgw01-05) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) ) #178-Ubuntu SMP Fri Aug 11 12:48:20 UTC 2017 (Ubuntu 3.13.0-129.178-generic 3.13.11-ckt39)
Sep 10 05:15:01 ip-172-31-51-116 kernel: [ 0.00
@jeff-kilbride
jeff-kilbride / webpack.config.js
Created March 11, 2017 20:23
css-loader error webpack.config.js
'use strict';
const webpack = require('webpack'),
path = require('path'),
ETPlugin = require('extract-text-webpack-plugin');
// Entry and build paths.
const PUBLIC_DIR = path.resolve(__dirname, 'public'),
BUILD_DIR = path.resolve(PUBLIC_DIR, 'js'),
/**
* checkParams tests the params object against the required object.
* The required object can take the following forms:
*
* { paramName: true }
*
* paramName in params is ONLY tested for existence.
*
* {
* paramName: {
@jeff-kilbride
jeff-kilbride / docker-volume-cleanup.sh
Created August 9, 2016 20:30
Clean up dangling / orphan Docker volumes
#!/bin/bash
# Because I keep forgetting this command...
DANGLING_VOLUMES=$(docker volume ls -qf dangling=true)
if [ -n "$DANGLING_VOLUMES" ]; then
echo $'\nRemoving volumes:'
docker volume rm $DANGLING_VOLUMES
else
echo $'\nNo dangling volumes to remove.'
fi