Skip to content

Instantly share code, notes, and snippets.

View david-adewoyin's full-sized avatar
🏠
Working from home

David Adewoyin david-adewoyin

🏠
Working from home
View GitHub Profile
@david-adewoyin
david-adewoyin / min-char-rnn.py
Created October 16, 2022 16:23 — forked from karpathy/min-char-rnn.py
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)
@david-adewoyin
david-adewoyin / bash_strict_mode.md
Created August 11, 2021 10:24 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u