A Pen by Pankaj Patel on CodePen.
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
| module.exports = (scope) => `<article> | |
| <header> | |
| <h1><a href="${scope.link}">${scope.title}</a></h1> | |
| </header> | |
| ${require(`./tags.html.js`)(scope)} | |
| <div> | |
| <video src=${scope.video.src} autoplay="off"></video> | |
| </div> | |
| <div>${scope.video.description}</div> | |
| <div>${scope.body}</div> |
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
| module.exports = (scope) => `<article> | |
| <header> | |
| <h1><a href="${scope.link}">${scope.title}</a></h1> | |
| </header> | |
| ${require(`./tags.html.js`)(scope)} | |
| <div> | |
| ${scope.body} | |
| </div> | |
| </article>` |
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
| module.exports = (scope) => `${scope.type ? | |
| require(`${scope.type}.html.js`)(scope) : ` | |
| <h1>${scope.title || '---'}<h1> | |
| <div>${scope.body || '...')</div> | |
| `}`; |
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
| code,kbd,pre,samp{font-family: Inconsolata,Consolas,Menlo,Monaco,Courier New,monospace}code.prettyprint,pre.prettyprint{color: #fff;background-color: #444;padding: 1em;line-height: 1.5}pre.prettyprint.small{padding: .5em}pre .tooltip{position: relative;cursor: pointer}pre .tooltip .property{border-bottom: 1px dotted #fff}pre .tooltip .property .kwd{color: #508b88}pre .tooltip:hover:after{content: attr(data-tooltip);position: absolute;background: rgba(0,0,0,.85);padding: 5px 9px;color: #fff;border-radius: 3px;left: 0;top: 25px;width: 390px;z-index: 100}.pln{color: #000}@media screen{.str{color: #080}.kwd{color: #008}.com{color: #800}.typ{color: #606}.lit{color: #066}.clo,.opn,.pun{color: #660}.tag{color: #008}.atn{color: #606}.atv{color: #080}.dec,.var{color: #606}.fun{color: red}}@media print,projection{.str{color: #060}.kwd{color: #006;font-weight: 700}.com{color: #600;font-style: italic}.typ{color: #404;font-weight: 700}.lit{color: #044}.clo,.opn,.pun{color: #440}.tag{color: #006;font-weight: 700}.atn{color |
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
| const topLevel = [ | |
| { label: 'Home', url: '/home' }, | |
| { label: 'Products', url: '/products' }, | |
| { label: 'Services', url: '/services' }, | |
| { label: 'About', url: '/about-us' }, | |
| { label: 'Contact', url: '/contact-us' }, | |
| ]; | |
| const social = [ | |
| { label: '<i class="fa fa-facebook-square"></i>', url: 'https://facebook.com/time2hack' }, |
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
| const generatePreviewData = (file, callback) => { | |
| const fr = new FileReader(); | |
| fr.addEventListener('load', (e) => { | |
| if(callback && typeof callback === 'function') callback(fr.result); | |
| }); | |
| fr.readAsDataURL(file); | |
| } |
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
| 'use strict'; | |
| const Hapi = require('hapi'); | |
| const server = new Hapi.Server(); | |
| server.connection({ | |
| host: 'localhost', | |
| port: Number(process.argv[2]) || 8080 | |
| }); |
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
| -- AppleScript to create a new file in Finder | |
| -- | |
| -- Use it in Automator, with the following configuration: | |
| -- - Service receives: no input | |
| -- - In: Finder.app | |
| -- | |
| -- References: | |
| -- - http://apple.stackexchange.com/a/129702 | |
| -- - http://stackoverflow.com/a/6125252/2530295 | |
| -- - http://www.russellbeattie.com/blog/fun-with-the-os-x-finder-and-applescript |