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
Last active May 28, 2020
[Twig filters] #d8 #twig
View 1.md

trans / t

This filter (alternatively, t) will run the variable through the Drupal t() function, which will return a translated string. This filter should be used for any interface strings manually placed in the template that will appear for users.

<a href="{{ url('<front>') }}" title="{{ 'Home'|t }}" rel="home" class="site-logo"></a>
@robdecker
robdecker / 1.md
Created May 18, 2020
[Paste.app: non subscription] #macos
@robdecker
robdecker / 1.twig
Created May 18, 2020
[Tiles with bottom borders of varying number of columns] #d8 #twig
View 1.twig
{% set quantity = tiles|length %}
{% set attributes = {
class: [
'tiles'
],
'data-quantity': quantity,
'data-layout': num_cols,
'data-modulo-2': quantity % 2,
'data-modulo-3': quantity % 3,
'data-modulo-4': quantity % 4,
@robdecker
robdecker / 1.md
Created May 14, 2020
[VS Code tips] #macos
View 1.md

Explorer keyboard navigation

Command: list.toggleKeyboardNavigation

@robdecker
robdecker / php-get-vimeo-video-id-from-url.php
Last active May 7, 2020 — forked from anjan011/php-get-vimeo-video-id-from-url.php
[Get Vimeo Video ID from URL in PHP] #php
View php-get-vimeo-video-id-from-url.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 — forked from ghalusa/youtube_id_regex.php
[Extract the YouTube Video ID from a URL in PHP] #php
View youtube_id_regex.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 May 6, 2020
[Drupal, PhpStorm/VSCode, Lando, xDebug] #d8
@robdecker
robdecker / 1.md
Created May 1, 2020
[What's running on a port] #macos #sh
View 1.md
@robdecker
robdecker / 1.md
Created May 1, 2020
[Show/hide hidden files in Finder] #macos
View 1.md
command + shift + . (dot/period)
You can’t perform that action at this time.