Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeff Kilbride jeff-kilbride

  • Los Angeles, CA
View GitHub Profile
View filter-wp-uploads.php
<?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 Nov 17, 2017
Log of mocha-sidebar activity
View developer-console.log
/*******************************************************/
/* 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]
View plugin-config.js
'use strict';
module.exports = {
host: process.env.API_HOST,
keys: {
private: process.env.API_KEY
},
endpoints: [
['admin.alive', '/admin/alive'],
View plugin-index.js
'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;
View app.js
'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 Oct 17, 2017
Server level glue / confidence config
View server-config.js
'use strict';
module.exports = {
Glue: {
server: {
cache: {
name: 'redis',
engine: 'catbox-redis',
host: process.env.REDIS_HOST,
@jeff-kilbride
jeff-kilbride / syslog.txt
Created Sep 16, 2017
Goofys reboot syslog
View syslog.txt
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 Mar 11, 2017
css-loader error webpack.config.js
View 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'),
View checkParams.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 Aug 9, 2016
Clean up dangling / orphan Docker volumes
View docker-volume-cleanup.sh
#!/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