- plain ol' React
let state = initial
render(view(state), element)viewis pure!
| // credit: Louis Lazaris | |
| document.onreadystatechange = function () { | |
| switch (document.readyState) { | |
| case 'loading': | |
| console.log('loading...'); | |
| break; | |
| case 'interactive': | |
| console.log('DOM is ready...'); | |
| break; | |
| case 'complete': |
| sudo curl -o /usr/local/bin/imgcat -O https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat && sudo chmod +x /usr/local/bin/imgcat | |
| # If you have a better way to fix the permissions, comment below! |
| window.onerror = function(message) { | |
| top.location.href = 'http://stackoverflow.com/search?q=' + | |
| encodeURIComponent(message + ' [js]'); | |
| }; |
Compile with:
webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.jsUse with the following index.html
npm users sorted by the monthly downloads of their modules, for the range May 6, 2018 until Jun 6, 2018.
Metrics are calculated using top-npm-users.
| # | User | Downloads |
|---|
| // adapted from https://tonicdev.com/n3dst4/twelve-days-of-emoji | |
| // full credit to n3dst4. I just rewrote this to be browser developer tools friendly. | |
| const pressies = [ | |
| "🐦🍐🌳", | |
| "🐢🐦", | |
| "🇫🇷🐔", | |
| "📞🐦", | |
| "💛💍", | |
| "🐦🍳 ", | |
| "🐦🏊", |
| #! /usr/bin/env python | |
| # coding: utf-8 | |
| ''' | |
| auto switch keyboard between different applications | |
| if you want to change the app list, modify the var 'ignore_list' | |
| ''' | |
| from AppKit import NSWorkspace, NSWorkspaceDidActivateApplicationNotification, NSWorkspaceApplicationKey |
@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).
Here we go with the explanations:
(function(x, f = () => x) {