Skip to content

Instantly share code, notes, and snippets.

View robdecker's full-sized avatar

Rob Decker robdecker

View GitHub Profile
@robdecker
robdecker / clear-drupal-cache.php
Last active November 2, 2019 02:12 — forked from samsargent/clear-drupal-cache.php
[Clear all caches from a php file] #d6
<?php
include_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
drupal_flush_all_caches();
?>

brewStack update for fresh install

Install steps:

  • Install Homebrew:

      $ ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)  
      $ brew install git  
      $ brew update  
    

$ brew install drush

@robdecker
robdecker / how-to-get-youtube-video-id.md
Last active March 30, 2021 22:14 — forked from jakebellacera/how-to-get-youtube-video-id.md
[Learn how to get the ID of any YouTube video] #video #youtube

How to get the ID of any YouTube Video

This article walks you through how to get the ID of any YouTube video.

How to get a YouTube video ID from a youtube.com page URL

You may be watching the video or just happened to visit a link to a video. The video ID will be located in the URL of the video page, right after the v= URL parameter.

@robdecker
robdecker / Breadcrumbs.php
Last active October 17, 2019 19:49 — forked from jonpugh/Breadcrumbs.php
[Add Taxonomy Term to a Node's Breadcrumb in Drupal 8] #d8
<?php
// src/Breadcrumbs.php
namespace Drupal\modulename;
use Drupal\Core\Breadcrumb\BreadcrumbBuilderInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Breadcrumb\Breadcrumb;
use Drupal\Core\Link;
@robdecker
robdecker / export_vscode_extesions.md
Last active January 28, 2020 19:47 — forked from joseluisq/export_vscode_extesions.md
[How to export your VS Code extensions from terminal] #macos

How to export your VS Code extensions from terminal

Note: Unix-like systems only.

  1. Export your extensions to a shell file:
code --list-extensions | sed -e 's/^/code --install-extension /' > my_vscode_extensions.sh
@robdecker
robdecker / vanilla-js-cheatsheet.md
Last active April 8, 2020 22:02 — forked from thegitfather/vanilla-js-cheatsheet.md
[Vanilla JavaScript Quick Reference / Cheatsheet] #js
@robdecker
robdecker / 1.md
Last active April 18, 2020 20:21 — 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

List, mount, etc

List disks

diskutil list

Mount ISO

hdiutil mount ~/Downloads/name_of_file.iso

@robdecker
robdecker / php-get-vimeo-video-id-from-url.php
Last active May 7, 2020 20:58 — forked from anjan011/php-get-vimeo-video-id-from-url.php
[Get Vimeo Video ID from URL in PHP] #php
<?php
/**
* Get Vimeo video id from url
*
* Supported url formats -
*
* https://vimeo.com/11111111
* http://vimeo.com/11111111
@robdecker
robdecker / youtube_id_regex.php
Created May 7, 2020 20:56 — forked from ghalusa/youtube_id_regex.php
[Extract the YouTube Video ID from a URL in PHP] #php
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
@robdecker
robdecker / debug.php
Last active January 19, 2021 18:50 — forked from zakiya/debug.php
[Debugging php in Drupal] #d8
<?php>
function myfunction($app) {
// ~~ Core.
// debug($app);
// dump($app);
// var_dump($app);
// ~~ Devel + kint library + settings
// dpr($app);
// kint($app);