Skip to content

Instantly share code, notes, and snippets.

@es-sam
es-sam / how-to-get-youtube-video-id.md
Created November 14, 2019 16:59 — forked from jakebellacera/how-to-get-youtube-video-id.md
Learn how to get the ID of any YouTube video.

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.

@es-sam
es-sam / 0.md
Last active July 14, 2022 19:44
Custom Luminate CMS Author Toolbar

Custom Luminate CMS Author Toolbar

A drop-in replacement for the default CMS admin toolbar with a simple vertical design, tested with jQuery 1.8.3. Uses HTML5 localStorage so this setting will persist as long as you do not clear your site/browser data.

Custom Luminate CMS Author Toolbar

@es-sam
es-sam / 0.md
Created August 9, 2018 18:44
Font size conditional

Conditional based on string length

In the example below, set different font size based on length of affiliate name

  • If name contains 1-20 characters, set font size to 20px
  • If name contains 21-30 characters, set font size to 18px
  • If name contains 31-40 characters, set font size to 16px
  • Otherwise, name must contain more than 40 characters, so set font size to 14px
<span style="font-size: [[?x1x2x3x4x5x6x7x8x9x10x11x12x13x14x15x16x17x18x19x20x::x[[E130: "[[S80:site_name]]" length]]x::20::[[?x21x22x23x24x25x26x27x28x29x30x::x[[E130: "[[S80:site_name]]" length]]x::18::[[?x31x32x33x34x35x36x37x38x39x40x::x[[E130: "[[S80:site_name]]" length]]x::16::14]]]]]]px;">[[S80:site_name]]</span>
@es-sam
es-sam / README.md
Created May 14, 2018 18:51 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@es-sam
es-sam / reading-a-cookie.html
Last active May 17, 2017 14:14 — forked from makbeta/reading-a-cookie.html
[Read value from header cookie] #tags:CMS
@es-sam
es-sam / three-random-items-list.html
Last active May 16, 2017 20:14 — forked from makbeta/three-random-items-list.html
[Display 3 random list items] #tags: CMS
<t:if test="length > 0"><!-- is there a list? -->
<t:set id="iRandom" value="random(length)+1" /><!-- set a variable equal to a number between 1 and the length of the list -->
<!-- if random number is within 2 of the last item in the list, subtract 2 -->
<t:if test="iRandom >= (length-2) && iRandom <= length">
<t:set id="iRandom" value="iRandom-2" />
</t:if>
<!-- if the variable is now negative due to the subtraction above, reset it to 1 (the first list item) -->
<t:if test="iRandom <= 0">
@es-sam
es-sam / reus_ismobile.html
Last active August 28, 2017 15:29 — forked from makbeta/isMobile.html
[Set isMobile session variable] #LO #STag
<!-- Copyright 2010 Convio, Inc. -->
<!--
Conditional for detecting mobile devices
[[?xx::x[[S80:isMobile]]x::
isMobile is not yet set
[[?xx::x[[S80:UserAgentLowerCase]]x::
UserAgentLowerCase is not yet set
Convert User-Agent from HTTP request header to lower case
[[U0:UserAgentLowerCase=[[E130:"[[S50:User-Agent]]" "A" "a" replaceall "B" "b" replaceall "C" "c" replaceall "D" "d" replaceall "E" "e" replaceall "F" "f" replaceall "G" "g" replaceall "H" "h" replaceall "I" "i" replaceall "J" "j" replaceall "K" "k" replaceall "L" "l" replaceall "M" "m" replaceall "N" "n" replaceall "O" "o" replaceall "P" "p" replaceall "Q" "q" replaceall "R" "r" replaceall "S" "s" replaceall "T" "t" replaceall "U" "u" replaceall "V" "v" replaceall "W" "w" replaceall "X" "x" replaceall "Y" "y" replaceall "Z" "z" replaceall]]]]
@es-sam
es-sam / wwm-sortable.js
Last active May 2, 2017 16:34
[Sort WWM events] Using tablesorter JS plugin #tags: JS, LO, TR
// See Tablesorter @ http://tablesorter.com/docs/
$(document).ready(function() {
$("#sort_table").tablesorter( {sortList: [[0,0], [1,0]]} );
});