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 React, { Component } from 'react' | |
import { connect } from 'react-redux' | |
import WorldPop from './components/WorldPop/WorldPop' | |
class App extends Component { | |
render() { | |
let $chart | |
switch (this.props.chart) { | |
case 'WorldPop': |
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
Node.prototype.on = HTMLElement.prototype.addEventListener | |
NodeList.prototype.on = function(event, cb) { | |
Array.prototype.forEach.call(this, el => el.addEventListener(event, cb)) | |
} | |
// usage: $('.element').on('click', ...) | |
// usage: $('.list-of-elements').on('click', ...) |
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
HTMLElement.prototype.show = function() { | |
this.style.display = '' | |
} | |
HTMLElement.prototype.hide = function() { | |
this.style.display = 'none' | |
} | |
HTMLElement.prototype.toggle = function(bool) { | |
this.style.display = bool ? '' : 'none' | |
} | |
HTMLElement.prototype.visible = function() { |
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
NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator] | |
// usage: $$('.list-of-elements').forEach(...) | |
// usage: $$('.list-of-elements').map(...) |
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
window.$ = document.querySelector.bind(document) | |
window.$$ = document.querySelectorAll.bind(document) | |
HTMLElement.prototype.$ = HTMLElement.prototype.querySelector | |
HTMLElement.prototype.$$ = HTMLElement.prototype.querySelectorAll | |
// usage: $('.select-on-element') | |
// usage: $$('.select-a-list-of-element') |
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
SERVER_URL?='http://website.dev' | |
echo_server: | |
echo $(SERVER_URL) |
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
livereload: | |
livereload --exts "less js html" |
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
grunt.initConfig({ | |
watch: { | |
all: { | |
files: ['*.less', '*.js', '*.html'], | |
options: { | |
livereload: true | |
} | |
} | |
} | |
}); |
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
watch: | |
watchy -w css/**/*.less -- make css |
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
grunt.initConfig({ | |
watch: { | |
less: { | |
files: ['css/**/*.less'], | |
tasks: ['css'] | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-watch'); |
NewerOlder