Update node using nvm
nvm install 6.3
nvm alias default 6.3
nvm use 6.3
Install and Update pm2
npm install pm2@latest -g ; pm2 update
| # lazyload nvm | |
| # all props goes to http://broken-by.me/lazy-load-nvm/ | |
| # grabbed from reddit @ https://www.reddit.com/r/node/comments/4tg5jg/lazy_load_nvm_for_faster_shell_start/ | |
| lazynvm() { | |
| unset -f nvm node npm npx | |
| export NVM_DIR=~/.nvm | |
| [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
| if [ -f "$NVM_DIR/bash_completion" ]; then | |
| [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion |
| #!/bin/bash | |
| sudo add-apt-repository -y ppa:git-core/ppa | |
| sudo apt-get update | |
| sudo apt-get install git -y |
An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.
| 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 && \ |
curl to get the JSON response for the latest releasegrep to find the line containing file URLcut and tr to extract the URLwget to download itcurl -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:
$ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)$ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is 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." (regular commit will work if global signing is enabled)sudo tar -xf Franz-linux-x64-0.9.10.tgz -C /opt/franzwget "https://cdn-images-1.medium.com/max/360/1*v86tTomtFZIdqzMNpvwIZw.png" -O franz-icon.png then sudo cp franz-icon.png /opt/franzsudo touch /usr/share/applications/franz.desktop then sudo vim /usr/share/applications/franz.desktoppaste the following lines into the file, then save the file:
[Desktop Entry]
Name=Franz
Comment=
| 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 |
| // 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(); |