Skip to content

Instantly share code, notes, and snippets.

View rajvijen's full-sized avatar
🏠
Working From Home

Vijendra Kumar rajvijen

🏠
Working From Home
View GitHub Profile
@bitliner
bitliner / test_api_with_authentication.js
Last active July 18, 2020 07:56 — forked from bq1990/gist:595c615970250e97f3ea
Supertest authenticate with bearer token
'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
@jirutka
jirutka / sample.png
Last active April 26, 2023 14:03
Nested numbered list with correct indentation in CSS. Live example at http://jsfiddle.net/a84enL8k/.
sample.png
@ranjithkumar8352
ranjithkumar8352 / smsClient.js
Last active July 26, 2023 19:23
Send TextLocal SMS using Node.js
//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"
}
@davemackintosh
davemackintosh / map-to-json.js
Last active August 7, 2023 15:49
Convert ES6 `Map`s to a standard JSON object without effing Babel.
/**
* 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) => {
@joyrexus
joyrexus / README.md
Last active January 21, 2024 21:51 — forked from btoone/curl.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

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"
@awesomebytes
awesomebytes / code_connect_via_command_line.md
Last active March 26, 2024 09:54
How to open Visual Studio Code via command line (local file, remote-ssh, docker, remote-docker)

How to open Visual Studio Code via command line

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).

Local file or folder

code <file or folder>
# e.g. code .
@graydon
graydon / country-bounding-boxes.py
Created April 23, 2014 00:03
country bounding boxes
# 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)),
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
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

C++ OOPS Concepts

The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.

Characteristics of an Object Oriented Programming language

img