Skip to content

Instantly share code, notes, and snippets.

Rob Decker robdecker

Block or report user

Report or block robdecker

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
@robdecker
robdecker / 1.md
Created Apr 23, 2020
[Find command] #sh
View 1.md

Find all folders (starting in the current folder) based on a partial folder name

find . -type d -name "*searchname*"
@robdecker
robdecker / 1.md
Last active May 6, 2020
[Drupal, PhpStorm/VSCode, Lando, xDebug] #d8
@robdecker
robdecker / 1.md
Last active Apr 18, 2020 — forked from bzerangue/_verify-repair-permissions-disk.md
[Mac OS X Utilities via Terminal] Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine #macos
View 1.md

List, mount, etc

List disks

diskutil list

Mount ISO

hdiutil mount ~/Downloads/name_of_file.iso

@robdecker
robdecker / vanilla-js-cheatsheet.md
Last active Apr 8, 2020 — forked from thegitfather/vanilla-js-cheatsheet.md
[Vanilla JavaScript Quick Reference / Cheatsheet] #js
View vanilla-js-cheatsheet.md
@robdecker
robdecker / 1.md
Last active Mar 20, 2020
[Optional chaining in nested javascript objects] #js
View 1.md
var street = user.address && user.address.street;
var street = user.address?.street;
var street = user.address?.street ?? 'None';
@robdecker
robdecker / 1.js
Created Mar 18, 2020
[Javascript map] #js
View 1.js
const items = [
{
title: 'Item 1'
},
{
title: 'Item 2'
},
{
title: 'Item 3'
},
@robdecker
robdecker / 1.css
Created Feb 25, 2020
[Vertical align image in overflow:hidden div] #css
View 1.css
div {
position: relative;
overflow: hidden;
}
img {
position: absolute;
top: 50%;
transform: translate(0, -50%);
}
@robdecker
robdecker / 1.php
Created Feb 20, 2020
[Add inline JavaScript to a page] #d8 #js
View 1.php
/**
* Implements hook_page_attachments().
*/
function MODULE_NAME_page_attachments(array &$attachments) {
// You can optionally perform a check to make sure you target a specific page.
if (\Drupal::routeMatch()->getRouteName() == 'some.route') {
// Add our JS.
$attachments['#attached']['html_head'][] = [
[
'#tag' => 'script',
You can’t perform that action at this time.