Skip to content

Instantly share code, notes, and snippets.

View vnugent's full-sized avatar

Viet Nguyen vnugent

View GitHub Profile
@vnugent
vnugent / countries_codes_and_coordinates.csv
Created September 15, 2022 11:09 — forked from tadast/countries_codes_and_coordinates.csv
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude coordinates
Country Alpha-2 code Alpha-3 code Numeric code Latitude (average) Longitude (average)
Afghanistan AF AFG 4 33 65
Albania AL ALB 8 41 20
Algeria DZ DZA 12 28 3
American Samoa AS ASM 16 -14.3333 -170
Andorra AD AND 20 42.5 1.6
Angola AO AGO 24 -12.5 18.5
Anguilla AI AIA 660 18.25 -63.1667
Antarctica AQ ATA 10 -90 0
Antigua and Barbuda AG ATG 28 17.05 -61.8
case 'areas': {
if (dbOp === 'update') {
const prevId = fullDocument?._change?.prevChangeId
if (prevId != null) {
const area = await getChangeLogModel().aggregate([
{ $match: { _id: prevId } },
{
$project:
{
changes: {
@vnugent
vnugent / california-climbing-destinations.json
Created April 9, 2022 20:13
Possible climbing destinations in CA
{
"data": {
"areas": [
{
"pathTokens": [
"US",
"California",
"Sierra Eastside",
"Bishop Area",
"Volcanic Tablelands (Happy/Sad Boulders)",
@vnugent
vnugent / climbing-destinations.md
Created April 9, 2022 20:10
US climbing destinations

Connect to OpenBeta graphql

Go to https://graphiql-online.com/graphiql

Endpoint: https://api.openbeta.io

query MyQuery {
 areas(filter: {field_compare: [{num: 0.5, field: density, comparison: gt}, {num: 400, field: totalClimbs, comparison: gt}], path_tokens: {tokens: "California"}}, sort: {density: -1}) {
@vnugent
vnugent / plate-custom-normalizer.js
Created November 15, 2021 13:12
Create your own Platejs plugin
// createCustomNormalizingPlugin.js
import { getChildren } from "@udecode/plate-common";
import { getPlatePluginWithOverrides, isElement } from "@udecode/plate-core";
const withCustomNormalizing = (options) => (editor) => {
const { normalizeNode } = editor;
editor.normalizeNode = ([node, path]) => {
//console.log("#foos ", node);
import { unified } from "unified";
import markdown from "remark-parse";
import slate, { defaultNodeTypes, serialize } from "remark-slate";
const DEFAULT_HEADINGS = {
1: "h1",
2: "h2",
3: "h3",
4: "h4",
5: "h5",
@vnugent
vnugent / yds-utils.js
Last active September 21, 2020 16:39
Yosemite Decimal System validator & comparator
// match 5.0 up to 5.15 including + and -. Example: 5.10+ or 5.12-
const REGEX_5_X = RegExp(/^5\.([0-9]|1[0-5])([+-]?)$/);
// match 5.10x to 5.15x. Example: 5.12c
const REGEX_5_10_LETTER = RegExp(/^5\.(1[0-5])([abcd])(?:\/[abcd])?$/);
/**
* Test if a grade string is in valid format
* @param {yds} grade
*/
import React, { useEffect, useState } from "react"
import {
Grid,
AppBar,
Toolbar,
Container,
Divider,
Paper,
Drawer,
Button,

DigitalOcean droplets

#/etc/dnsmasq.d/origin-dns.conf
server=67.207.67.2
server=67.207.67.3

Errors