Skip to content

Instantly share code, notes, and snippets.

View pressure679's full-sized avatar

Vittus Mikiassen pressure679

View GitHub Profile
@ianlivingstone
ianlivingstone / ast_test.py
Created July 9, 2011 18:05
Uses Python AST Module to build a dict/list representaiton of only module/function/classes and then pulls keywords from their docstrings
import ast
import sys
import pprint
import re
type_lookup = {
ast.Module: 'Module',
ast.FunctionDef: 'Function',
ast.ClassDef: 'Class'
}
/*
Theme Name: ReClean
Theme URI: http://www.codenx.com/
Theme Version: 1.0
Theme Date: 2013-03-12
Theme Author: CodeNx
Theme Author URI: http://www.codenx.com/
Theme License: GPLv2
*/
@todgru
todgru / starttmux.sh
Last active May 27, 2024 08:20
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@Yagisanatode
Yagisanatode / Tkinter_filedialog.py
Last active July 15, 2021 11:58
Python 3 - Open file dialog window in tkinter with filedialog
#! Python 3.4
"""
Open a file dialog window in tkinter using the filedialog method.
Tkinter has a prebuilt dialog window to access files.
This example is designed to show how you might use a file dialog askopenfilename
and use it in a program.
"""
@karpathy
karpathy / min-char-rnn.py
Last active July 24, 2024 18:36
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)
"""
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)
@isidroamv
isidroamv / gz-reader.go
Last active March 13, 2024 11:48
Reading a txt gzip file with golang
func ReadGzFile(filename string) ([]byte, error) {
fi, err := os.Open(filename)
if err != nil {
return nil, err
}
defer fi.Close()
fz, err := gzip.NewReader(fi)
if err != nil {
return nil, err
@DrewBarfieldProductions
DrewBarfieldProductions / fuchsia_build.sh
Last active October 9, 2023 20:26
BASH script to build and boot Google Fuchsia
#!/bin/sh
clear
# Preparing the build environment
# https://github.com/fuchsia-mirror/manifest#prerequisites
# https://github.com/fuchsia-mirror/magenta/blob/master/docs/getting_started.md#preparing-the-build-environment
sudo apt-get install golang git-all curl texinfo libglib2.0-dev autoconf libtool libsdl-dev build-essential
# Creating a new checkout (https://github.com/fuchsia-mirror/manifest#creating-a-new-checkout)
curl -s https://raw.githubusercontent.com/vanadium/go.jiri/master/scripts/bootstrap_jiri | bash -s fuchsia
@bussiere
bussiere / compress.go
Created December 22, 2016 01:16
compress uncompress a string in golang
package main
import (
"bytes"
"compress/gzip"
"fmt"
"encoding/base64"
"io/ioutil"
)