https://twitter.com/jonkemp/status/935658759917133825 https://twitter.com/eveporcello/status/935651907154083840 https://twitter.com/americanwombat/status/935646093580427264 https://twitter.com/reverentgeek/status/935645859009712128 https://twitter.com/RyanTablada/status/935644625661984787 https://twitter.com/benmvp/status/935639056591007744 https://twitter.com/wiredferret/status/935633365713276928 https://twitter.com/howlowck/status/935630784752508929 https://twitter.com/JesseRWeigel/status/935886385428430848 https://twitter.com/JesseRWeigel/status/935556298963288066
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 a bookmark and use this code as the URL, you can now toggle the css on/off | |
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
javascript: (function() { | |
var elements = document.body.getElementsByTagName('*'); | |
var items = []; | |
for (var i = 0; i < elements.length; i++) { | |
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) { | |
items.push(elements[i]); | |
} | |
} |
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
import classNameProp from 'class-name-prop'; | |
import { useRouter } from 'next/router'; | |
import React from 'react'; | |
import styles from './RouteIndicator.module.css'; | |
const DONE_DURATION = 250; | |
export default function RouteIndicator() { | |
const router = useRouter(); |
Name of thing | Sorta like... | Mounted? | Can you even setState? | What would you say... ya do here? |
---|---|---|---|---|
constructor | initialize() | nope | nope | init stuff NO side effects |
componentWillMount | beforeDomReady() | nope | yeah but don't | Only needed in createClass now use constructor for most things |
render | render | nope | please no | render stuff and don't set any state please |
componentDidMount | domReady() | yup | yup | DOM is a go init jQuery plugins dispatch stuff |
componentWillReceiveProps | onChange() | yup | yup |
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
// inifinite scrolling of content without extra wrappers | |
const { render, findDOMNode } = ReactDOMFiber | |
class App extends React.Component { | |
render() { | |
// wrap the root element with an Intersection Observer, exposing .observe for children | |
return <Intersection> | |
<div style={{ height: 200, overflow: 'auto' }}> | |
<Page offset={0} count={10} /> | |
</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
#!/bin/bash | |
MAIN=${1:-development} | |
BRANCHES=$(git branch --merged $MAIN | grep -v -e 'master\|staging\|development\|\*') | |
echo Branches merged into $MAIN: | |
echo $BRANCHES | |
read -p "Delete these branches (y/n)? " answer |
The following recipes are sampled from a trained neural net. You can find the repo to train your own neural net here: https://github.com/karpathy/char-rnn Thanks to Andrej Karpathy for the great code! It's really easy to setup.
The recipes I used for training the char-rnn are from a recipe collection called ffts.com And here is the actual zipped data (uncompressed ~35 MB) I used for training. The ZIP is also archived @ archive.org in case the original links becomes invalid in the future.
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 gulp = require('gulp') | |
var browserify = require('browserify') | |
var watchify = require('watchify') | |
var babelify = require('babelify') | |
var source = require('vinyl-source-stream') | |
var buffer = require('vinyl-buffer') | |
var merge = require('utils-merge') |
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 elements = document.querySelectorAll("div"), | |
callback = (el) => { console.log(el); }; | |
// Spread operator | |
[...elements].forEach(callback); | |
// Array.from() | |
Array.from(elements).forEach(callback); | |
// for...of statement |