Skip to content

Instantly share code, notes, and snippets.

View rajinwonderland's full-sized avatar
🛰️
Exploring

Raj K Singh rajinwonderland

🛰️
Exploring
View GitHub Profile
@rajinwonderland
rajinwonderland / README.md
Last active October 7, 2023 18:27
US State Bounding Boxes

US State Bounding Boxes

The following are the extents of each US state and territory in NAD83 (EPSG:4269) and WGS84 (EPSG:4326) coordinates using the 2017 US Census 1:500,000 shapefile.

The tranformer.py file is a Python script that uses the pyproj library to transform the NAD83 coordinates to WGS84.

NAD83 EPSG:4269

STATEFP STUSPS NAME xmin ymin xmax ymax
@rajinwonderland
rajinwonderland / prettify.ts
Created May 2, 2023 17:47
Prettify for Classes
type Prettify<T> = {
[K in keyof T]: T[K]
} & {}
@rajinwonderland
rajinwonderland / example.ts
Created September 15, 2021 19:21
Determining an arguments type from an argument (typescript)
interface Author {
id: string;
firstName: string;
lastName: string;
address: Address;
email: string;
posts: Post[]
}
interface Post {
@rajinwonderland
rajinwonderland / disposable-email-provider-domains
Created March 22, 2021 21:45
List of disposable email provider domains
0815.ru
0wnd.net
0wnd.org
10minutemail.co.za
10minutemail.com
123-m.com
1fsdfdsfsdf.tk
1pad.de
20minutemail.com
21cn.com
@rajinwonderland
rajinwonderland / http-graphql-request.js
Created January 11, 2021 21:56
Using node's http to make a vanilla request to a graphql server
const https = require('https')
const query = `
query GetCurrencyInfo($CODE: [String!]) {
currencies(currencyCodes: $CODE) {
name
code
decimalDigits
numericCode
active
state latitude longitude name
AK 63.588753 -154.493062 Alaska
AL 32.318231 -86.902298 Alabama
AR 35.20105 -91.831833 Arkansas
AZ 34.048928 -111.093731 Arizona
CA 36.778261 -119.417932 California
CO 39.550051 -105.782067 Colorado
CT 41.603221 -73.087749 Connecticut
DC 38.905985 -77.033418 District of Columbia
DE 38.910832 -75.52767 Delaware
@rajinwonderland
rajinwonderland / memorySizeOf.js
Created March 4, 2020 01:06
Calculate Memory Size of a JS Object
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if (obj !== null && obj !== undefined) {
switch (typeof obj) {
case "number":
bytes += 8;
break;
case "string":
@rajinwonderland
rajinwonderland / julia-cheats.md
Last active January 25, 2020 19:50
Julia Cheat Sheet [WIP]
@rajinwonderland
rajinwonderland / linux-docker-machine-install.fish
Last active January 24, 2020 18:51
`docker-machine` Installation on a fish shell
curl -L https://github.com/docker/machine/releases/download/v0.16.0/docker-machine-(uname -s)-(uname -m) >/tmp/docker-machine \
&& sudo mv /tmp/docker-machine /usr/local/bin/docker-machine \
&& chmod +x /usr/local/bin/docker-machine
@rajinwonderland
rajinwonderland / print_factors.py
Last active November 30, 2019 21:57
Print Factors
# For printing factors of a given number
# i.e print_factors(2) => 1, 2
def print_factors(x):
print("The factors of",x,"are:")
for i in range(1, x + 1):
if x % i == 0:
print(i)