vi filename.txt- Open a file:- Enter Command Modeu- Undo changesctrl+u- Redo Changes:q- Quit Vim:q!- Force quit vim without saving
This article is inspired by Brad Cypert's blog post: http://www.bradcypert.com/building-a-simple-api-in-php-using-lumen/.
Why should we build a API with Vanilla PHP? Because you can, and it makes fun.
- Create a directory /src
This short tutorial describes how to upload GPS tracks to Strava using your command line interface / shell. It requires no special tools or any 3rd party code.
Run the following steps with your user logged in to Strava in your browser!
Strava uses OAuth to authenticate against 3rd party applications. In order to authenticate to your Strava account from your command line, you first have to generate an API key. Therefore go to this page https://strava.github.io/api/v3/oauth/ and create a new API. The settings are as follows:
| // 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
| const axios = require('axios'); // promised based requests - like fetch() | |
| function getCoffee() { | |
| return new Promise(resolve => { | |
| setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
| }); | |
| } |
| RewriteCond %{REQUEST_FILENAME}.html -f | |
| RewriteRule ^(.+)/$ $1.html [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteRule .*[^/]$ %{REQUEST_URI}/ [L,R=301] | |
| <IfModule mod_deflate.c> | |
| AddOutputFilterByType DEFLATE text/html text/plain text/css application/json | |
| AddOutputFilterByType DEFLATE application/javascript | |
| AddOutputFilterByType DEFLATE text/xml application/xml text/x-component | |
| AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml |
| [Desktop Entry] | |
| Encoding=UTF-8 | |
| Name=Postman | |
| Exec=postman | |
| Icon=/home/USERNAME/Postman/app/resources/app/assets/icon.png | |
| Terminal=false | |
| Type=Application | |
| Categories=Development; |
- Do you have an Github account ? If not create one.
- Install required tools
- Latest Git Client
- gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
Matrix is:
an open standard for decentralised communication, providing simple HTTP APIs and open source reference implementations for securely distributing and persisting JSON over an open federation of servers.
It's pretty fantastic, if you think on the massive problem of fragmentation all across the web. They've created an easy to use API, and you can do a kludgy test using curl from the terminal (*nix, mac, win). See: http://matrix.org/docs/howtos/client-server.html
It's pretty straightforward to do a quick test. I have an account at https://matrix.org / https://vector.im, so I used that to get a token.