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 TodoList from './components/TodoList' | |
import TodoInput from './components/TodoInput' | |
import Filter from './components/Filter' | |
import './App.css' | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> |
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 parseURL(url) { | |
// Assign resource as string | |
const parser = document.createElement('a') | |
parser.href = url | |
return { | |
// hash // == "#chiripiorca" | |
hash: parser.hash, | |
// host // == "www.chespirito.com:3000" | |
host: parser.host, |
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
yarn add -D webpack webpack-cli webpack-dev-server babel-loader@next @babel/core @babel/preset-env @babel/preset-stage-0 html-webpack-plugin |
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
// The events are from https://www.w3.org/TR/html5/semantics-embedded-content.html#media-elements-event-summary | |
import videojs from 'video.js' | |
const Plugin = videojs.getPlugin('plugin') | |
const EVENTS = [ | |
'loadstart', | |
'progress', | |
'suspend', | |
'abort', | |
'error', |
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 results, currentWindow, | |
// create an iframe and append to body to load a clean window object | |
iframe = document.createElement('iframe'); | |
iframe.style.display = 'none'; | |
document.body.appendChild(iframe); | |
// get the current list of properties on window | |
currentWindow = Object.getOwnPropertyNames(window); |
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
// keep track of the loaded libraries | |
const loadedLibraries = [] | |
function registerLibraryLoaded(id) { | |
// record the libs only if the array doesn't contain the same already | |
if (loadedLibraries.indexOf(id) < 0) { | |
loadedLibraries.push(id) | |
} | |
} |
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
const int LED = 13; | |
const int PWR = 12; | |
char blueName[4] = "lazy"; | |
char pin[5] = "0000"; | |
char blueSpeed = "4"; | |
char mode = "1"; // 0 slave, 1 master | |
void setup() { | |
pinMode(LED, OUTPUT); |
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
dig +short google.com | |
host google.com | |
nslookup google.com |
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
<div id="root"></div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.21.1/babel.min.js"></script> | |
<script> | |
Babel.registerPreset("custom-preset", { | |
presets: [ | |
[Babel.availablePresets["es2015"]], | |
], | |
plugins: [ | |
Babel.availablePlugins["syntax-jsx"], | |
[Babel.availablePlugins["transform-react-jsx"], { |
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
const start = new Date() | |
const hrstart = process.hrtime() | |
const simulateTime = 500 | |
setTimeout(function(argument) { | |
// execution time simulated with setTimeout function | |
const end = new Date() - start | |
const hrend = process.hrtime(hrstart) | |
console.info('Execution time: %dms', end) |