Skip to content

Instantly share code, notes, and snippets.

Working from 🛰

Harry Moreno morenoh149

Working from 🛰
View GitHub Profile
View Balanced Parentheses Prompt
# write a function that takes a string of text and returns true if
# the parentheses, brackets, and braces are balanced and false otherwise.
# Example:
# balanceParens('[](){}'); // true
# balanceParens('[({})]'); // true
# balanceParens('[(]{)}'); // false
# Step 3:
morenoh149 /
Created Apr 12, 2017 — forked from brigand/
A guide to writing high impact redux tests.

Some people will tell you to test everything in your app. If you have time to kill, go for it. For most of us, we want to focus on tests that help us sleep at night. We'll be using jest in this guide, mostly because it provides snapshot testing.


This isn't something people normally test, but it saves us from typos that only show up in response to user interaction. Often we fail to dispatch all of the actions in our manual testing of UIs.

The premise here is simple, we want to know that all of our keys are actual functions. We'll be

morenoh149 /
Created Jul 7, 2018 — forked from karpathy/
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
morenoh149 / postgis-geojson-liaison.js
Created Nov 9, 2018 — forked from DesignByOnyx/postgis-geojson-liaison.js
Helpful utility for converting postgis data into GeoJSON as it comes out of the db, and vice versa.
View postgis-geojson-liaison.js
var wkx = require('wkx')
var pg = require('pg')
var pgUtil = require('pg/lib/utils')
const geoParser = {
// 1. Convert postgis data coming out of the db into geoJSON
// Every postgres installation will have different oids for postgis geo types.
.raw('SELECT oid, typname AS name FROM pg_type WHERE typname IN (\'geography\', \'geometry\');')
morenoh149 /
Last active Jun 20, 2020 — forked from robulouski/
Basic example of using Python3 and IMAP to read emails in a gmail folder/label. Remove legacy email.header api use
#!/usr/bin/env python
# Basic example of using Python3 and IMAP to read emails in a gmail folder/label.
# Remove legacy email.header api use.
import sys
import imaplib
import getpass
import email
import datetime