Skip to content

Instantly share code, notes, and snippets.

@ewg118
ewg118 / geonames_feature_codes.csv
Created April 16, 2020 17:37
Geonames - Wikidata - Getty AAT Feature Code Concordance
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 9 columns, instead of 3 in line 5.
Geonames Feature Code,Geonames Label,Wikidata URI,Wikidata label,AAT ID,AAT label,description,Geonames Feature Class,Wikipedia Code
ADM1,first-order administrative division,http://www.wikidata.org/entity/Q10864048,first-level administrative country subdivision,http://vocab.getty.edu/aat/300387064,first level subdivisions (political entities),"a primary administrative division of a country, such as a state in the United States",A,A.ADM1
ADM1H,historical first-order administrative division,,,,,a former first-order administrative division,A,A.ADM1H
ADM2,second-order administrative division,http://www.wikidata.org/entity/Q13220204,second-level administrative country subdivision,http://vocab.getty.edu/aat/300387145,second level subdivisions (political entities),a subdivision of a first-order administrative division,A,A.ADM2
ADM2H,historical second-order administrative division,,,,,a former second-order administrative division,A,A.ADM2H
ADM3,third-order administrative division,http://www.wikidata.org/entity/Q132217
@lyquix-owner
lyquix-owner / simpleEncryptUtil.js
Last active November 15, 2023 18:55
Super simple UTF-8 safe JavaScript xor encryption, decryption function, with password derivated key, and hash functions - Demo: https://jsfiddle.net/lyquix/dyf05wh3/
/**
* Super simple encryption utilities
* Inspired by https://gist.github.com/sukima/5613286
* Properly handles UTF-8 strings
* Use these functions at your own risk: xor encryption provides only acceptable
* security when the key is random and longer than the message
* If looking for more reliable security use: https://tweetnacl.js.org/
*
* Use passwordDerivedKey function in this file to generate a key from a password, or to generate a random key
*/
@woudsma
woudsma / retrain-mobilenet-for-the-web.md
Last active November 1, 2022 05:09
Retrain a MobileNet model for the web with TensorFlow for Poets and TensorFlow.js

Retrain a MobileNet model and use it in the browser with TensorFlow.js

DRAFT

Combining TensorFlow for Poets and TensorFlow.js.
Retrain a MobileNet V1 or V2 model on your own dataset using the CPU only.
I'm using a MacBook Pro without Nvidia GPU.

MobileNets can be used for image classification. This guide shows the steps I took to retrain a MobileNet on a custom dataset, and how to convert and use the retrained model in the browser using TensorFlow.js. The total time to set up, retrain the model and use it in the browser can take less than 30 minutes (depending on the size of your dataset).

Example app - HTML/JS and a retrained MobileNet V1/V2 model.

@manrajgrover
manrajgrover / .env.sample
Last active January 29, 2024 12:56
Quick Docker Environment for TensorFlowJS Node
root=/path/to/root
project=/path/to/project
@marcocitus
marcocitus / example.sql
Last active February 24, 2024 13:17
Safe incremental rollups on Postgres and Citus
-- Create the raw events table
CREATE TABLE page_views (
site_id int,
path text,
client_ip inet,
view_time timestamptz default now(),
view_id bigserial
);
-- Allow fast lookups of ranges of sequence IDs
@ManzDev
ManzDev / rollup.config.js
Created February 24, 2018 17:13
RollUp Config file for easy ES6 to ES5 bundle
import babel from 'rollup-plugin-babel';
import eslint from 'rollup-plugin-eslint';
import resolve from 'rollup-plugin-node-resolve';
import multiEntry from 'rollup-plugin-multi-entry';
import uglify from 'rollup-plugin-uglify';
import filesize from 'rollup-plugin-filesize';
import commonjs from 'rollup-plugin-commonjs';
import progress from 'rollup-plugin-progress';
let pluginOptions = [
@joelouismarino
joelouismarino / googlenet.py
Last active October 24, 2024 05:51
GoogLeNet in Keras
from __future__ import print_function
import imageio
from PIL import Image
import numpy as np
import keras
from keras.layers import Input, Dense, Conv2D, MaxPooling2D, AveragePooling2D, ZeroPadding2D, Dropout, Flatten, Concatenate, Reshape, Activation
from keras.models import Model
from keras.regularizers import l2
from keras.optimizers import SGD
@sukima
sukima / XORCipher.js
Last active October 29, 2025 11:05
A Super simple encryption cipher using XOR and Base64 in JavaScript
// XORCipher - Super simple encryption using XOR and Base64
//
// Depends on [Underscore](http://underscorejs.org/).
//
// As a warning, this is **not** a secure encryption algorythm. It uses a very
// simplistic keystore and will be easy to crack.
//
// The Base64 algorythm is a modification of the one used in phpjs.org
// * http://phpjs.org/functions/base64_encode/
// * http://phpjs.org/functions/base64_decode/
@springmeyer
springmeyer / create_index.js
Created August 10, 2011 23:41
create an sqlite rtree spatial index using node-sqlite3 and node-mapnik
/*
wget http://dl.dropbox.com/u/342088/10m-us-parks-area.sqlite
ogr2ogr -f SQLite parks.sqlite ParkPly_900913.shp
dane$ ogr2ogr -f SQLite parks.sqlite ~/Documents/MapBox/cache/2976a0c1-10m-us-parks-area/2976a0c1-10m-us-parks-area.shp
*/