Install express and nodemon.
sudo npm install -g express
sudo npm install -g nodemon
Create express project.
| function sendDailyWisdom() { | |
| var FIRST_ROW = 2; | |
| var ss = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; | |
| var rows = ss.getRange(FIRST_ROW, 1, ss.getLastRow(), 1).getValues(); | |
| var randomWisdomRow = Math.floor(Math.random() * (rows.length - FIRST_ROW + 1)) + FIRST_ROW; | |
| var randomWisdom = ss.getRange(randomWisdomRow, 1).getValue(); | |
| var source = ss.getRange(randomWisdomRow, 2).getValue(); | |
| var htmlBody = | |
| '<div style="width: 500px; font-family: Times New Roman; font-size: 18px;">' + | |
| randomWisdom + |
| loadData() { | |
| this.setState({ | |
| ...this.state, | |
| requestInProgress: true, | |
| }); | |
| return this.http.get(url).pipe( | |
| tap(data => { | |
| this.setState({ | |
| ...this.state, | |
| data: data, |
| { | |
| "AD": { | |
| "iso": "AD", | |
| "iso3": "AND", | |
| "numeric": 20, | |
| "fips": "AN", | |
| "reference": { | |
| "geonames": 3041565, | |
| "openstreetmap": 9407, | |
| "wikipedia": "en:Andorra" |
| // Polyfill for rAF | |
| window.requestAnimFrame = (function() { | |
| return window.requestAnimationFrame || | |
| window.webkitRequestAnimationFrame || | |
| window.mozRequestAnimationFrame || | |
| function(callback) { | |
| window.setTimeout(callback, 1000 / 60); | |
| }; | |
| })(); |
| { | |
| // http://eslint.org/docs/rules/ | |
| "env": { | |
| "browser": true, | |
| "es6": true, | |
| }, | |
| "globals": { | |
| "$": true, | |
| "jQuery": true |
| $('body').click(function(event) { | |
| var el, rfs; | |
| if ($('body').hasClass('fullscreen')) { | |
| el = document; | |
| rfs = el.cancelFullScreen || el.webkitCancelFullScreen || el.mozCancelFullScreen; | |
| $('body').removeClass('fullscreen'); | |
| } else { | |
| el = document.documentElement; | |
| rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen; |
| //base font | |
| $bf: 16; | |
| @mixin bp($bp, $min-max: min-width) { | |
| $em: $bp/$bf; | |
| @media(#{$min-max}: #{$em}em) { @content; } | |
| } | |
| //including the mixin | |
| .element { |
| <table> | |
| <thead> | |
| <tr> | |
| <th>Payment</th> | |
| <th>Issue Date</th> | |
| <th>Amount</th> | |
| <th>Period</th> | |
| </tr> | |
| </thead> | |
| <tbody> |
| .selector { | |
| /* Positioning */ | |
| position: absolute; | |
| z-index: 10; | |
| top: 0; | |
| right: 0; | |
| /* Display & Box Model */ | |
| display: inline-block; | |
| overflow: hidden; |