Skip to content

Instantly share code, notes, and snippets.

View zhangzhengfu's full-sized avatar
🎯
Focusing

ZhangZhengFu zhangzhengfu

🎯
Focusing
View GitHub Profile
@zhangzhengfu
zhangzhengfu / imgcat
Created April 24, 2021 07:05 — forked from krtx/imgcat
fix imgcat to be able to display images on tmux https://gitlab.com/gnachman/iterm2/issues/3898#note_14097715
#!/bin/bash
# tmux requires unrecognized OSC sequences to be wrapped with DCS tmux;
# <sequence> ST, and for all ESCs in <sequence> to be replaced with ESC ESC. It
# only accepts ESC backslash for ST.
function print_osc() {
if [[ -n $TERM ]] ; then
printf "\033Ptmux;\033\033]"
else
printf "\033]"
@zhangzhengfu
zhangzhengfu / min-char-rnn.py
Created February 24, 2018 15:54 — 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)