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
| <?php | |
| /* Cache proxy for darksky.net API requests */ | |
| define('API_KEY', '***********************'); | |
| define('TIMEOUT', 10 * 60); // In seconds (10 minutes) | |
| // Coordinates MUST be the first element in URL as https://api.server.io/v1/weather/[LAT,LON] | |
| $params = explode('/', trim($_SERVER['PATH_INFO'], '/')); | |
| $coords = filter_var(array_shift($params), FILTER_SANITIZE_STRING); | |
| // Validate coordinates |
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
| export default { | |
| bind(el, bindings) { | |
| el.dragEvents = ['dragenter', 'dragover', 'dragleave', 'drop']; | |
| el.dragEvents.forEach(dragEvent => { | |
| el.addEventListener(dragEvent, (event) => { | |
| if (!el.classList.contains(dragEvent)) { | |
| el.classList.remove(...el.dragEvents); | |
| el.classList.add(dragEvent); | |
| } | |
| event.preventDefault(); |
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
| export default { | |
| bind(el, binding) { | |
| const { value: { msg, callback } } = binding; | |
| el.ask = () => { | |
| if (confirm(msg)) callback(); | |
| }; | |
| el.addEventListener('click', el.ask); | |
| }, | |
| unbind(el) { el.removeEventListener('click', el.ask); } | |
| }; |
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
| .scroll-show { | |
| opacity: 0; | |
| transition: all 0.5s ease-in-out; | |
| } | |
| .scroll-show-enter { opacity: 1; } |
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
| rules: { | |
| 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', | |
| 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', | |
| 'no-tabs': 'off', | |
| 'indent': ['error', 'tab', { | |
| 'SwitchCase': 1 | |
| }], | |
| 'max-len': ['error', { | |
| 'code': 100, | |
| 'ignoreTrailingComments': true, |
NewerOlder