Skip to content

Instantly share code, notes, and snippets.

View robdecker's full-sized avatar

Rob Decker robdecker

View GitHub Profile

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";

parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port;     // => "3000"
parser.pathname; // => "/pathname/"
parser.search;   // => "?search=test"
parser.hash; // => "#hash"
@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 / 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);
@robdecker
robdecker / debug.twig
Last active January 19, 2021 18:50 — forked from zakiya/debug.twig
[Debugging Twig in Drupal] #d8 #twig
{# ~ Core ~ #}
{# {{ dump() }} #}
{# {{ dump(page) }} #}
{# ~ Devel~ #}
{# {{ kint()}} #}
{# {{ kint(page)}} #}
{# {{ devel_dump(page) }} #}
{# {{ devel_breakpoint() }} #}
@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 / 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 / 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 / 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