This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var $consoleLog = $('<div id="console-log"></div>'), | |
newLine = function(){return $('<p class="console-line"></p>'); }, | |
cssText = '.console-line{margin:10px;padding:10px;background-color:#ededed;border:1px solid #ccc;font-weight:700;font-family:monospace;color:#333;font-size:18px}.dir{background-color:#80e5a6}.info{background-color:#cff}.warn{background-color:#fdfd96}.error{background-color:#ff6961}', | |
$style = $('<style>' + cssText + '</style>'); | |
//reminder: jQuery is a dependency! | |
$('body').prepend($consoleLog); | |
$('body').append($style); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//set variables | |
var videoId = '', | |
youTubeUrlBase = 'https://www.youtube.com/watch?v=', | |
youTubeUrl = 'https://www.youtube.com/watch?v=JMP3MUwoEmw'; | |
//returns the youtube ID from a URL | |
function getYoutubeId (url){ | |
var myregexp = /(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i, | |
retArr = url.match(myregexp); | |
Code Examples for my Blog Post: Getting Started with the Mapbox Maps SDK for React Native
Code Examples for my Blog Post: JavaScript Spread Syntax – Basics
Code Examples for my Blog Post: JavaScript Destructuring – Basics
Code Examples for my Blog Post: What is the difference between LET and CONST in JavaScript?
Code Examples for my Blog Post: How do I set up an Angular click-event handler?
The full Github repo can be found here: github.com/kevinchisholm/video-code-examples/tree/master/angular/templates-and-data/click-attribute
Code Examples for my Blog Post: Angular Parent to Child Communication with @Input()
The full Github repo can be found here: github.com/kevinchisholm/video-code-examples/tree/master/angular/components/@input
OlderNewer