Skip to content

Instantly share code, notes, and snippets.

Working from 🛰

Harry Moreno morenoh149

Working from 🛰
View GitHub Profile
morenoh149 /
Last active Jul 29, 2022
quick binary tree
class Tree:
def __init__(self, data):
self.left = None
self.right = None = data
def insert(self, data):
if isinstance(, int):
if self.left is None:
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
morenoh149 /
Last active Feb 27, 2020
Django update alternate model instances in shell
Update alternate instances of a model in the database.
from app.models import Post
ids_to_update = list(Post.objects.all().values_list('id', flat=True))[1::2]
Post.objects.filter(id__in=ids_to_update).update(some_field='some value')
$ ./k
2020.02.25 (c) shakti
$k a.k
Verb Adverb Noun Type System
: set ' each char " a" c \l a.k
+ plus flip / over/right i enc name ``ab n *\d [d]
morenoh149 /
Last active Feb 1, 2020
Intro to smart contract programming in solidity Oct 2019
morenoh149 /
Last active Jan 27, 2020
Intro to blockchain programming in js

Introduction to Blockchain Programming, Jan 2020

Explain blockchain

Chain of blocks

morenoh149 / dp01.js
Created Feb 26, 2019
Dynamic programming example
View dp01.js
// The following was translated from python.
// See
const dynamicCoinChanging = (coins, target) => {
let n = coins.length;
let dp = [0];
for (let i=0; i < target; i++) {
for (let i=0; i <= n; i++) {
morenoh149 /
Created Feb 12, 2019
Tensorflow serve on Sagemaker
def export_h5_to_pb(path_to_h5, export_path):
# Set the learning phase to Test since the model is already trained.
# Load the Keras model
keras_model = load_model(path_to_h5)
# Build the Protocol Buffer SavedModel at 'export_path'
builder = saved_model_builder.SavedModelBuilder(export_path)

Soldity Workshop


Attendees should do the following before the event to get the most out of it. There will be a 20 minute lecture-overview at the beginning. You can do the prerequisites during the overview if you have not done so by then.

  1. install node.js (lts version is recommended)
  2. install git (use brew if on osx)
  3. install a code editor (vscode or
morenoh149 /
Created Dec 5, 2018
Advent of Code 2018 Day 4 solution
import re
import pprint
pp = pprint.PrettyPrinter(indent=2)
def Input():
filename = './input.txt'
return open(filename)
lines = Input().read().split('\n')