Skip to content

Instantly share code, notes, and snippets.

Avatar
Black Lives Matter

Andrew Patton acusti

Black Lives Matter
View GitHub Profile
@acusti
acusti / log.txt
Last active Nov 30, 2018
CSG flow errors
View log.txt
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│
View condense-meeting-times.js
// 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 Jul 9, 2021
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.
View install.sh
#!/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
View CodePen-→-WebPageTest.markdown

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 Aug 29, 2015
Towards a more perfect link underline
View Towards-a-more-perfect-link-underline.markdown
@acusti
acusti / Buttons-hover-effect.markdown
Last active Aug 29, 2015
A Pen by Andrew Patton.
View Buttons-hover-effect.markdown
View Video.js-disposal-in-overlay-box.markdown

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 Nov 7, 2017 — 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
View google-analytics.js
/**
* 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 Dec 30, 2015
JS file for the Blackbox Debug Bar WordPress plugin (http://wordpress.org/plugins/blackbox-debug-bar/)
View blackbox.js
hljs.initHighlightingOnLoad();
var WpDebugBar = {
element: ['globals', 'profiler', 'database', 'errors'],
open: null,
switchPanel: function(open) {
View Animate-scroll-with-CSS3-transition-(with-jQuery).markdown

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.