This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep -B6 bindings:.*: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set data = { | |
home_away: node.field_home_away_or_neutral.value, | |
no_audio: node.field_live_audio_unavailable.value, | |
venue: node.field_venue.entity.name.value, | |
tv_name: node.field_tv_channel.entity.name.value, | |
tv_logo: node.field_tv_channel.entity.field_logo.entity.getFileUri(), | |
competition: node.field_competition.entity.name.value, | |
competition_logo: node.field_competition.entity.field_logo.entity.getFileUri() | image_style('small'), | |
date: content.field_fixture_date, | |
date_override: content.field_date_override, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @type {{a: boolean, b: boolean, c: number}} | |
*/ | |
var x = {a: true}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
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. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find how many of a file type are here | |
howmany () { | |
find . -name "*.$1" | wc -l | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
// Twig docs for this: https://twig.symfony.com/doc/2.x/api.html | |
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// List to String (like JS's `join`) | |
/// Converts Sass list to string using `$glue` separator. | |
/// @param {list} $list | |
/// @param {string} $glue [''] - What join list items with (ex `,`) | |
/// @param {bool} $is-nested [false] | |
/// @return {string} | |
/// @link http://hugogiraudel.com/2013/08/08/advanced-sass-list-functions/ Source | |
@function to-string($list, $glue: '', $is-nested: false) { | |
$result: null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run on an image to see it's width & height in pixels, then copy the CSS syntax for it. | |
imgsize () { | |
width=$(mdls -name kMDItemPixelWidth -raw "$1") | |
height=$(mdls -name kMDItemPixelHeight -raw "$1") | |
echo "width: "$width"px; | |
height: "$height"px;" | pbcopy | |
echo "$width"x"$height" | |
} | |
# Displays all images in a directory with image sizes. Either pass in a folder or run as-is to list the current directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 {}' \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |