Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Working from 🛰

Harry Moreno morenoh149

💭
Working from 🛰
View GitHub Profile
@morenoh149
morenoh149 / gmail_imap_python3.py
Last active Jun 20, 2020 — forked from robulouski/gmail_imap_example.py
Basic example of using Python3 and IMAP to read emails in a gmail folder/label. Remove legacy email.header api use
View gmail_imap_python3.py
#!/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
@morenoh149
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 = {
init(knex){
// 1. Convert postgis data coming out of the db into geoJSON
// Every postgres installation will have different oids for postgis geo types.
knex
.raw('SELECT oid, typname AS name FROM pg_type WHERE typname IN (\'geography\', \'geometry\');')
@morenoh149
morenoh149 / min-char-rnn.py
Created Jul 7, 2018 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
View min-char-rnn.py
"""
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
morenoh149 / high-impact-redux-tests.md
Created Apr 12, 2017 — forked from brigand/high-impact-redux-tests.md
A guide to writing high impact redux tests.
View high-impact-redux-tests.md

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.

mapDispatchToProps

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

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: