Skip to content

Instantly share code, notes, and snippets.

Evan Lovely EvanLovely

Block or report user

Report or block EvanLovely

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View node--fixture--card.html.twig
{% set data = {
home_away: node.field_home_away_or_neutral.value,
no_audio: node.field_live_audio_unavailable.value,
tv_logo: node.field_tv_channel.entity.field_logo.entity.getFileUri(),
competition_logo: node.field_competition.entity.field_logo.entity.getFileUri() | image_style('small'),
date: content.field_fixture_date,
date_override: content.field_date_override,
View type
* @type {{a: boolean, b: boolean, c: number}}
var x = {a: true};
EvanLovely / LICENSE.txt
Created Jul 12, 2018 — forked from jed/LICENSE.txt
generate random UUIDs
View LICENSE.txt
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
EvanLovely / index.php
Last active Jan 25, 2018
Twig PHP CLI Render
View index.php
require_once 'vendor/autoload.php';
// Twig docs for this:
// First arg to CLI - template path
$templatePath = $argv[1];
// data is STDIN aka `echo '{"title": "hello there"}' | php index.php '@upone/bar.twig'`
$in_data = [];
$in = fgets(STDIN);
EvanLovely /
Last active Jun 12, 2017
Delete dep folders: `node_modules`, `bower_components`
# Delete dep folders: `node_modules`, `bower_components`
# @param $1 [.] Which folder to recursively look in; defaults to cwd (`.`).
delete-all-dep-folders() {
# `-prune` prevents building up lists of `node_modules` inside `node_modules`
find ${1:-.} -type d -name "node_modules" -prune -exec rm -rf '{}' \; -exec echo 'Deleted {}' \;
find ${1:-.} -type d -name "bower_components" -prune -exec rm -rf '{}' \; -exec echo 'Deleted {}' \;
# This one is a little spooky as `vendor/` folders aren't exclusive to Composer.
# @todo Test if `composer.json` is next to `vendor/` before deleting.
# find ${1:-.} -type d -name "vendor" -prune -exec rm -rf '{}' \; -exec echo 'Deleted {}' \;
EvanLovely / .vimrc
Created May 24, 2017 — forked from mikecrittenden/.vimrc
A .vimrc with the bare minimum baseline defaults
View .vimrc
set backspace=2 " backspace in insert mode works like normal editor
set shiftwidth=2 " indent by 2 spaces when auto-indenting
set softtabstop=2 " indent by 2 spaces when hitting tab
syntax on " syntax highlighting
filetype indent on " activates indenting for files
set autoindent " auto indenting
set number " line numbers
colorscheme desert " colorscheme desert
set nobackup " get rid of anoying ~file
EvanLovely / Checkout github pull requests
Created May 1, 2017 — forked from piscisaureus/
Checkout github pull requests locally
View Checkout github pull requests

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

EvanLovely / Linking to external resources from the Drupal appearance
Last active Apr 12, 2017 — forked from grayside/
Linking to external resources from the Drupal appearance page
View Linking to external resources from the Drupal appearance

Adding links to Pattern Lab on Drupal Appearance page

Add this to

  pattern-lab: /themes/custom/THEME_NAME/pattern-lab/public/
  sassdoc: /themes/custom/THEME_NAME/dest/sassdoc/
EvanLovely / get_title_and_url.applescript
Created Mar 28, 2017 — forked from vitorgalvao/get_title_and_url.applescript
AppleScript and JavaScript for Automation to get frontmost tab’s url and title of various browsers.
View get_title_and_url.applescript
-- AppleScript --
-- This example is meant as a simple starting point to show how to get the information in the simplest available way.
-- Keep in mind that when asking for a `return` after another, only the first one will be output.
-- This method is as good as its JXA counterpart.
-- Google Chrome
tell application "Google Chrome" to return title of active tab of front window
tell application "Google Chrome" to return URL of active tab of front window
-- Google Chrome Canary
View DiamondKeysMappings.kmlibrary
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
You can’t perform that action at this time.