Skip to content

Instantly share code, notes, and snippets.

View acusti's full-sized avatar
Black Lives Matter

Andrew Patton acusti

Black Lives Matter
View GitHub Profile
@acusti
acusti / log.txt
Last active November 30, 2018 15:15
CSG flow errors
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/brandcast-next/shared/api/api-crud.js:40:92
Cannot get edge.node because property node is missing in mixed [1].
node_modules/brandcast-next/shared/api/api-crud.js
37│ stringOf(get(result, ['data', fieldName, 'pageInfo', 'endCursor']));
38│
39│ const getResults = (result, fieldName: string) =>
40│ arrayOf(get(result, ['data', fieldName, 'edges'])).map((edge) => objectOf(edge && edge.node));
41│
// Take an array of meeting time ranges and return an array of condensed ranges
// https://www.interviewcake.com/question/merging-ranges
function condense_meeting_times(times) {
let timeline = [];
times.forEach((time) => {
//time[0], time[1]
// time is a tuple witih beginning and end
if (timeline[time[0]] === undefined) {
timeline[time[0]] = time[1];
@acusti
acusti / install.sh
Last active May 3, 2022 03:39
WordPress install script using WP-CLI: supports Multisite, MAMP, local php.ini overrides, and theme and plugin scaffolding, and will generate optimized .gitignore and .htaccess files.
#!/bin/bash
# Install WordPress
# =================
# Based on many sources, but originally based on:
# @ http://premium.wpmudev.org/blog/set-up-wordpress-like-a-pro/
# See also: http://wprealm.com/blog/wordpress-wp-cli-kung-fu-made-simple/
# BEGIN Configuration
@acusti
acusti / CodePen-→-WebPageTest.markdown
Created December 21, 2014 15:49
CodePen → WebPageTest

CodePen → WebPageTest

Building a script to overlay some options, then send current pen’s debug URL to WebPageTest.

Todo:

  • Rename .key to something else so React doesn't complain
  • Validate form fields on submit
  • Add Close button to overlay form
  • Add UI to help users determine how to enter location and understand options
  • If possible, add option to specify multiple locations
@acusti
acusti / Towards-a-more-perfect-link-underline.markdown
Last active August 29, 2015 14:10
Towards a more perfect link underline
@acusti
acusti / Buttons-hover-effect.markdown
Last active August 29, 2015 14:08
A Pen by Andrew Patton.

Video.js disposal in overlay box

Reduced test case for creating and disposing of video.js players in a (colorbox) overlay box.

A Pen by Andrew Patton on CodePen.

License.

@acusti
acusti / google-analytics.js
Last active November 7, 2017 00:23 — forked from ismyrnow/google-analytics-amd.js
Barebones google analytics RequireJS module wrapper for “universal analytics” with example of how to use it within a single page application
/**
* Google analytics include (using "Universal Analytics")
* https://gist.github.com/acusti/8718758
*/
/*global define */
define(function(require) {
'use strict';
@acusti
acusti / blackbox.js
Last active December 30, 2015 22:39
JS file for the Blackbox Debug Bar WordPress plugin (http://wordpress.org/plugins/blackbox-debug-bar/)
hljs.initHighlightingOnLoad();
var WpDebugBar = {
element: ['globals', 'profiler', 'database', 'errors'],
open: null,
switchPanel: function(open) {

Animate scroll with CSS3 transition (with jQuery)

Same as the sans jQuery version from which it was forked but with jQuery.

A Pen by Andrew Patton on CodePen.

License.