This file contains hidden or 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); | |
This file contains hidden or 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); |
Code Examples for my Blog Post: Set Up A Node / Express Static Web Server In Five Minutes
The full Github repo can be found here: Node Express Static Web Server
Code Examples for my Blog Post: What is the difference between LET and CONST in JavaScript?
Code Examples for my Blog Post: Getting Started with the Mapbox Maps SDK for React Native
Code Examples for my Blog Post: How to Fly To a Location with the Mapbox Maps SDK for React Native
This file contains hidden or 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
import React, {Component} from 'react'; | |
import {View, Image} from 'react-native'; | |
import MapboxGL from '@mapbox/react-native-mapbox-gl'; | |
MapboxGL.setAccessToken(YOUR_ACCESS_TOKEN); | |
const coordinates = [ | |
[-73.98330688476561, 40.76975180901395], | |
[-73.96682739257812, 40.761560925502806], | |
[-74.00751113891602, 40.746346606483826], |
Code Examples for my Blog Post: How Do I Detect A Text-input Change Event With Angular
The full Github repo can be found here: https://github.com/kevinchisholm/video-code-examples/tree/master/angular/templates-and-data/change-attribute
OlderNewer