Skip to content

Instantly share code, notes, and snippets.

Avatar

Edwin Onuonga eonu

View GitHub Profile
@eonu
eonu / viewr.R
Created Nov 1, 2020
viewr: Better R object inspection using the FireFox JSON viewer.
View viewr.R
# ================================================================================= #
# viewr: Better R object inspection using the FireFox JSON viewer. #
# --------------------------------------------------------------------------------- #
# Usage: #
# Rscript viewr.R [FILE] # Where [FILE] has extension .Rdata or .rds #
# #
# This script will only work on macOS, and assumes that you have FireFox installed! #
# --------------------------------------------------------------------------------- #
# Edwin Onuonga (eonu) 2020 #
# ================================================================================= #
@eonu
eonu / nbx
Last active Jan 29, 2020
NBX
View nbx
#!/usr/bin/env ruby
class NBX
# Execute long-running Jupyter notebooks from the command-line
def initialize
@allow_errors = true
@inplace = false
end
@eonu
eonu / ml.sh
Last active Jun 9, 2020
Basic conda environment for machine learning.
View ml.sh
conda create -n ml python=3.7.4 \
tensorflow tensorflow-datasets \
pytorch torchvision cudatoolkit=10.2 \
librosa torchaudio \
numpy scikit-learn scipy pandas \
matplotlib seaborn \
nltk \
pomegranate \
jupyter \
requests \
@eonu
eonu / active_record.rb
Last active Jul 30, 2019
ActiveRecord local test database
View active_record.rb
require 'active_record'
ENV['DATABASE_URL'] ||= "sqlite3:///path/to/db.sqlite3"
ActiveRecord::Base.establish_connection ENV['DATABASE_URL']
ActiveRecord::Schema.define do
self.verbose = true
create_table(:users, force: true) do |t|
t.string :username, null: false, unique: true