An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.
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
| These commands are based on a askubuntu answer http://askubuntu.com/a/581497 | |
| To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below. | |
| USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING. | |
| ABSOLUTELY NO WARRANTY. | |
| If you are still reading let's carry on with the code. | |
| sudo apt-get update && \ | |
| sudo apt-get install build-essential software-properties-common -y && \ | |
| sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ |
- Use
curlto get the JSON response for the latest release - Use
grepto find the line containing file URL - Use
cutandtrto extract the URL - Use
wgetto download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:
- Generate and add your key to GitHub
$ git config --global commit.gpgsign true([OPTIONAL] every commit will now be signed)$ git config --global user.signingkey ABCDEF01(whereABCDEF01is the fingerprint of the key to use)$ git config --global alias.logs "log --show-signature"(now available as$ git logs)$ git config --global alias.cis "commit -S"(optional if global signing is false)$ echo "Some content" >> example.txt$ git add example.txt$ git cis -m "This commit is signed by a GPG key."(regularcommitwill work if global signing is enabled)
- Download Franz for your distribution from MeetFranz.com
- change into the same directory as the downloaded file, then
sudo tar -xf Franz-linux-x64-0.9.10.tgz -C /opt/franz - (optional)
wget "https://cdn-images-1.medium.com/max/360/1*v86tTomtFZIdqzMNpvwIZw.png" -O franz-icon.pngthensudo cp franz-icon.png /opt/franz - (optional)
sudo touch /usr/share/applications/franz.desktopthensudo vim /usr/share/applications/franz.desktop
paste the following lines into the file, then save the file:
[Desktop Entry]
Name=Franz
Comment=
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
| var CSVer = function() { | |
| var spreadsheet_ = null; | |
| var dataSheet = null; | |
| // Set spreadsheet variable and creates new sheet within CSVer() object | |
| this.setUpSpreadsheet = function(){ | |
| spreadsheet_ = SpreadsheetApp.openById(ss_id); | |
| dataSheet = spreadsheet_.getSheetByName(dataTab_name); | |
| return this; | |
| } | |
| // Import file data into spreadsheet |
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
| // Setup: Spreadsheet in Pacific time, Script in Eastern time, Calendar in Mountain time. | |
| // Sample spreadsheet: https://docs.google.com/spreadsheets/d/1neePK1YPKMKnVwI8dld0HSJjI1kSFPpcY8g7kG8xG4U/edit#gid=0 | |
| // A2 = 3/1/2016 9:00 AM, B2 = 3/1/2016 10:00 AM | |
| /** | |
| * The dates and times in the spreadsheet refer to exact moments in time, and the clock | |
| * on the wall may show a different time. | |
| */ | |
| function copyMoment() { | |
| var ss = SpreadsheetApp.getActive(); |
A quick guide on how to setup Node.js development environment.
nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.
- Open new Terminal window.
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
| function createEventWithAttachment() { | |
| var driveFileId = '...'; | |
| var file = DriveApp.getFileById(driveFileId); | |
| var event = { | |
| summary: 'Test Event with Attachments', | |
| description: 'Woot!', | |
| attachments: [{ | |
| fileId: driveFileId, | |
| fileUrl: file.getUrl(), | |
| mimeType: file.getMimeType(), |