Skip to content

Instantly share code, notes, and snippets.

View webb24h's full-sized avatar

Marie-Eva Volmar webb24h

View GitHub Profile
@fajarlabs
fajarlabs / geo.js
Created October 19, 2021 02:18 — forked from mkhatib/geo.js
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {
@corinneling
corinneling / web-scraper-node-js.md
Last active February 24, 2022 23:21
Node web scraper with axios and cheerio

Node JS Web Scraper

I this is part of the first node web scraper I created with axios and cheerio. I took out all of the logic, since I only wanted to showcase how a basic setup for a nodejs web scraper would look.

const cheerio = require('cheerio'),
      axios = require('axios'),
      url = `<url goes here>`;
 
@thomasdarimont
thomasdarimont / keycloak.html
Created May 17, 2016 07:00
Keycloak JS Only public client example
<html>
<head>
<script src="http://localhost:8081/auth/js/keycloak.js" type="text/javascript">
</script>
</head>
<body>
<h1>js-demo-app</h1>
@kostasx
kostasx / php2js-curl-basic-auth.js
Last active February 7, 2022 23:08
PHP to Node.js: cURL with Basic Authentication
/*
<?php
// THE FOLLOWING IMPLEMENTATION CAN BE USED FOR VARIOUS APIs. THIS WAS TESTED SUCCESSFULLY ON THE pingdom.com API
$email = "your@mail.net";
$passwd = 'password';
$api_key = "API_KEY";
$curl = curl_init();
@rxaviers
rxaviers / output
Last active March 25, 2023 18:47
List of all JavaScript timezones (date.toString()) on linux node.js
/usr/share/zoneinfo/Hongkong
> Wed Jan 01 2014 00:00:00 GMT+0800 (HKT)
> Mon Sep 01 2014 00:00:00 GMT+0800 (HKT)
/usr/share/zoneinfo/Pacific/Easter
> Wed Jan 01 2014 00:00:00 GMT-0500 (EASST)
> Mon Sep 01 2014 00:00:00 GMT-0600 (EAST)
/usr/share/zoneinfo/Pacific/Norfolk
> Wed Jan 01 2014 00:00:00 GMT+1130 (NFT)
@mkhatib
mkhatib / geo.js
Created May 24, 2013 02:55
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {
@HarishChaudhari
HarishChaudhari / country-code-to-currency-code-mapping.csv
Last active April 26, 2024 12:10
Country, Country Code, Currency code mapping in CSV format Taken from https://gist.github.com/304261 Contains 249 countries.
Country CountryCode Currency Code
New Zealand NZ New Zealand Dollars NZD
Cook Islands CK New Zealand Dollars NZD
Niue NU New Zealand Dollars NZD
Pitcairn PN New Zealand Dollars NZD
Tokelau TK New Zealand Dollars NZD
Australian AU Australian Dollars AUD
Christmas Island CX Australian Dollars AUD
Cocos (Keeling) Islands CC Australian Dollars AUD
Heard and Mc Donald Islands HM Australian Dollars AUD
@ksafranski
ksafranski / Common-Currency.json
Last active April 22, 2024 15:16
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},