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
const BLOCK_TAGS = { | |
p: 'paragraph', | |
li: 'list-item', | |
ul: 'bulleted-list', | |
ol: 'numbered-list', | |
blockquote: 'quote', | |
pre: 'code', | |
h1: 'heading-one', | |
h2: 'heading-two', | |
h3: 'heading-three', |
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
// create the single note view where the user can edit it | |
import React, { Component } from 'react'; | |
import render from 'react-dom'; | |
import { Link } from 'react-router'; | |
import { connect } from 'react-redux'; | |
import { Editor } from 'slate-react' | |
import SlateHtml from 'slate-html-serializer'; | |
import { State } from 'slate'; | |
import * as parse5 from 'parse5'; | |
import NotesContainer from '../../containers/NotesContainer'; |
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
<div id="SomeElementYouWantToAnimate"></div> |
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
/* | |
* Return a Array of objects with tv show name and episodes, in my Google Play movies colletion | |
* https://play.google.com/movies | |
* Must be signed in and viewing the page for this to work | |
* Created by: Andrew Maxwell | |
* Created on: May 6th, 2016 | |
*/ | |
var tvShowsList = Array.prototype.slice.call(document.querySelectorAll('#body-content > div > div > div.main-content > div > div:nth-child(2) > div.tvshow-library > div')); | |
var getEpisodes = function(episodes) { | |
episodeNames = episodes.map(function(episode) { |
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
/* | |
* Return a Array of movie names in my Google Play movies colletion | |
* https://play.google.com/movies | |
* Must be signed in and viewing the page for this to work | |
* Created by: Andrew Maxwell | |
* Created on: May 6th, 2016 | |
*/ | |
var movieList = Array.prototype.slice.call(document.querySelectorAll('#body-content > div > div > div.main-content > div > div:nth-child(2) > div.id-cluster-container.cluster-container > div > div.id-card-list.card-list.two-cards > div')); | |
var movies = movieList.map(function(movie) { | |
var movieName = movie.innerText; |
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
/* | |
* Takes provided URL passed as argument and make full height screenshots of this page | |
* with several viewport widths using Nightwatch.js with Selenium. | |
* | |
* These viewport widths are taken from common android and iOS devices. Modify as needed. | |
* | |
* Takes an optional second argument for the path where screenshots are saved. | |
* | |
* Usage: | |
* $ node node_modules/.bin/nightwatch -t viewport-shots.js http://example.com |
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
<snippet> | |
<content><![CDATA[ | |
/* ========================================================================== | |
Bug #${1:12345} - ACM - ${2:01/01/14} | |
* ${3:Reason} | |
========================================================================== */ | |
]]></content> | |
<tabTrigger>jsBug</tabTrigger> | |
</snippet> |
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
<snippet> | |
<content><![CDATA[ | |
/* =========================================================================== | |
${1:title} | |
* ${2:content} | |
* | |
* @param <String> tag | |
* @return <Element> element | |
========================================================================== */ | |
]]></content> |
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
var increment; | |
for ( increment = 0; increment < 100; increment++ ) { | |
if ( increment % 15 === 0 ) { | |
console.log( 'fizzbuzz' ); | |
} else if ( increment % 3 === 0 ) { | |
console.log( 'fizz' ); | |
} else if ( increment % 5 === 0 ) { | |
console.log( 'buzz' ); | |
} else { |
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
var user = function(name, age, sex, job) { | |
this.name = name; | |
this.age = age; | |
this.sex = sex; | |
this.job = job; | |
}; | |
var andrew = new user('Andrew', 28, 'Male', 'Engineer'); | |
var whitney = new user('Whitney', 27, 'Female', 'Mom'); |
NewerOlder