An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
'use strict'; | |
var should = require('should'); | |
var app = require('../../app'); | |
var request = require('supertest')(app); | |
describe('GET /api/incidents', function() { | |
it('should require authorization', function(done) { | |
request |
//This code was posted for an article at https://codingislove.com/send-sms-developers/ | |
const axios = require("axios"); | |
const tlClient = axios.create({ | |
baseURL: "https://api.textlocal.in/", | |
params: { | |
apiKey: "YOUR API KEY", //Text local api key | |
sender: "6 CHARACTER SENDER ID" | |
} |
/** | |
* Convert a `Map` to a standard | |
* JS object recursively. | |
* | |
* @param {Map} map to convert. | |
* @returns {Object} converted object. | |
*/ | |
function map_to_object(map) { | |
const out = Object.create(null) | |
map.forEach((value, key) => { |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
git rm -r --cached . | |
git add . | |
git commit -m "fixing .gitignore" |
In order to open a Visual Studio Code sometimes we want to do it from the command line. Either because that allows us to just open the current file or folder, or because we would like to script opening some specific resource. This resource may be placed in another machine (e.g. via ssh), or in a docker container (running in the same machine or in another machine).
code <file or folder>
# e.g. code .
# extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip | |
# under public domain terms | |
country_bounding_boxes = { | |
'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)), | |
'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)), | |
'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)), | |
'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)), | |
'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)), | |
'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)), |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |