Skip to content

Instantly share code, notes, and snippets.

View alexfinnarn's full-sized avatar
🐙
Curious with tentacles

Alex Finnarn alexfinnarn

🐙
Curious with tentacles
View GitHub Profile
<?php
namespace Drupal\your_module\StackMiddleware;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;
/**
* Reduces the number of cache tags in the response.
*/

Application and Platform Maintenance

This document describes the ideal maintenance plan for the giving.cu.edu website currently hosted on the Pantheon platform. Work on this site dates back to 2015, and over the years several groups and their needs were folded into the growing list of features.

Giving site development roadmap

Vendors performed all development work up until the Donor Portal stage where DE (Digital Engagement) staff took over direction. Since February 2020, two developers within DE have worked on the Giving website with no

@alexfinnarn
alexfinnarn / script.sh
Created March 15, 2021 01:44
Copying Heroku Resources Through Pipeline
#!/usr/bin/env bash
# Install site if on review app. Import config if on other environments.
if [[ -z "$HEROKU_PR_NUMBER" ]]
then
echo "Not on a review app. No need to copy database."
else
# Split db url into parts since the pg:copy command needs it to confirm deletion.
# ${DB_NAME[3]} ends up being the database name.
# IFS is the internal string separator which needs set to forward-slash for parsing db url string.
@alexfinnarn
alexfinnarn / testing.asketch.json
Created June 12, 2020 18:39
Testing Sketch Import Tool
{"_class":"page","do_objectID":"ee98a8a8-fecd-44b2-93d7-78b085e186c1","exportOptions":{"_class":"exportOptions","exportFormats":[],"includedLayerIds":[],"layerOptions":0,"shouldTrim":false},"isFlippedHorizontal":false,"isFlippedVertical":false,"isLocked":false,"isVisible":true,"layerListExpandedType":0,"name":"Storybook","nameIsFixed":false,"resizingConstraint":63,"resizingType":0,"rotation":0,"shouldBreakMaskChain":false,"layers":[{"_class":"group","do_objectID":"67565cb5-e149-40c1-9cd0-7d3a3bea15e5","exportOptions":{"_class":"exportOptions","exportFormats":[],"includedLayerIds":[],"layerOptions":0,"shouldTrim":false},"isFlippedHorizontal":false,"isFlippedVertical":false,"isLocked":false,"isVisible":true,"layerListExpandedType":0,"name":"(body)","nameIsFixed":false,"resizingConstraint":63,"resizingType":0,"rotation":0,"shouldBreakMaskChain":false,"layers":[{"_class":"group","do_objectID":"074f8bf8-bb91-46c6-914f-28d7cf522276","exportOptions":{"_class":"exportOptions","exportFormats":[],"includedLayerIds":[],
@alexfinnarn
alexfinnarn / example-eslintrc.js
Created October 17, 2019 18:26
Example .eslintrc.js file
module.exports = {
parser: "babel-eslint",
env: {
browser: true,
node: true,
es6: true,
jest: true,
},
extends: [
"eslint:recommended",
@alexfinnarn
alexfinnarn / slack-introduction.json
Created October 14, 2019 20:38
Example payload for Slack Block Kit Builder
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Hello, all! It's time for me to make an attempt at wowing you so much you want to put some money in my pockets. I'm an experienced web developer working with *Drupal/PHP/JS* for most of my career but more recently also *React/React Native/Vue/Laravel* work. I'd love to join your team of talented engineers and help you ship robust and well-tested code."
}
},
{
@alexfinnarn
alexfinnarn / AutocompleteInput-behavior.js
Last active December 3, 2018 22:00
logic behind template
computed: {
fOptions() {
// Return filtered options...
},
options() {
return store.state.autocompleteOptions[this.optionsKey];
},
},
methods: {
onInput(value) {
@alexfinnarn
alexfinnarn / AutocompleteInput-template.vue
Created December 3, 2018 21:51
template of autocomplete component
<template>
<div class="autocomplete-input">
<input class="form-control"
@input="onInput($event.target.value)"
@keyup.esc="isOpen = false"
@blur="isOpen = false"
@keydown.down="moveDown"
@keydown.up="moveUp"
@keydown.enter="select"
v-model="keyword">

Keybase proof

I hereby claim:

  • I am alexfinnarn on github.
  • I am afinnarn (https://keybase.io/afinnarn) on keybase.
  • I have a public key ASAEbAz2RaIcae9K4veuv7KS1l5UdoBcngFC0316CYDFAAo

To claim this, I am signing this object:

function downloadFile(finalData) {
const data = new Blob([JSON.stringify(finalData, null, 2)], {type : 'application/json'});
if (navigator.msSaveBlob) {
// IE 10+.
navigator.msSaveBlob(data, 'directory.json');
} else {
const link = document.createElement('a');
if (link.download !== undefined) {
// Feature detection for Browsers that support HTML5 download attribute.