Skip to content

Instantly share code, notes, and snippets.

View GarrettMooney's full-sized avatar

Garrett Mooney GarrettMooney

View GitHub Profile
@jiahao
jiahao / setup_julia.sh
Last active January 20, 2022 03:43
Setting up Julia on an Amazon EC2 instance
#Set up data partition
sudo mkdir /data
sudo chmod 777 /data
sudo "echo /dev/xvdb /data ext4 rw,user,exec,comment=cloudconfig 0 2 >> /etc/fstab"
sudo mount /data
#Install build environment
sudo sed -i "s/enabled=0/enabled=1" /etc/yum.repos.d/epel.epo
sudo yum -y update
sudo yum -y upgrade
@tanyuan
tanyuan / smart-caps-lock.md
Last active June 18, 2024 19:36
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
@davidbjourno
davidbjourno / hydrogen.md
Created July 4, 2018 14:22
Hydrogen multiple kernels demo

Load, join and filter with Python/pandas

import pandas as pd

df_results = pd.read_csv(
    'data/raw/EU-referendum-result-data.csv',
    index_col='Area_Code')
df_aps = pd.read_csv(
    'data/raw/2395818381.csv',
    index_col='mnemonic',
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@raulqf
raulqf / Install_OpenCV4_CUDA11_CUDNN8.md
Last active June 11, 2024 15:44
How to install OpenCV 4.5 with CUDA 11.2 in Ubuntu 22.04

How to install OpenCV 4.5.2 with CUDA 11.2 and CUDNN 8.2 in Ubuntu 22.04

First of all install update and upgrade your system:

    $ sudo apt update
    $ sudo apt upgrade

Then, install required libraries:

@sidravi1
sidravi1 / hmc_anim.py
Created June 15, 2019 05:19
HMC animation
import autograd.numpy as np
import scipy.stats as st
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import matplotlib as mpl
import seaborn as sns
from minimc.minimc.minimc_slow import hamiltonian_monte_carlo as hmc_slow
from minimc.minimc import neg_log_normal, mixture
@MattPD
MattPD / analysis.draft.md
Last active June 6, 2024 00:22
Program Analysis Resources (WIP draft)
@junpenglao
junpenglao / theano-jax-test-drive.ipynb
Last active November 10, 2020 07:46
theano-jax test drive.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
library(tidyverse)
library(tictoc)
library(arrow)
tic()
con <- DBI::dbConnect(duckdb::duckdb(), "data/pbp_db.duckdb")
nfl_pbp <- tbl(con, "nflfastR_pbp")
toc()
import torch
import torch.utils.dlpack
import jax
import jax.dlpack
# A generic mechanism for turning a JAX function into a PyTorch function.
def j2t(x_jax):
x_torch = torch.utils.dlpack.from_dlpack(jax.dlpack.to_dlpack(x_jax))
return x_torch