Skip to content

Instantly share code, notes, and snippets.

View GarrettMooney's full-sized avatar

Garrett Mooney GarrettMooney

View GitHub Profile
@nikvdp
nikvdp / atuin.zsh
Created August 18, 2022 14:44
Use atuin to power ctrl-r history search but with fzf. Also disable atuin's up arrow bindings and use ctrl-e to bring up atuin's own tui
# make sure you have `tac` [1] (if on on macOS) and `atuin` [2] installed, then drop the below in your ~/.zshrc
#
# [1]: https://unix.stackexchange.com/questions/114041/how-can-i-get-the-tac-command-on-os-x
# [2]: https://github.com/ellie/atuin
atuin-setup() {
! hash atuin && return
bindkey '^E' _atuin_search_widget
export ATUIN_NOBIND="true"
@jinhangjiang
jinhangjiang / f1.py
Last active September 13, 2023 22:33
transformers_linear_regression
gpu_info = !nvidia-smi
gpu_info = '\n'.join(gpu_info)
if gpu_info.find('failed') >= 0:
print('Not connected to a GPU')
else:
print(gpu_info)
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
library(tidyverse)
library(tictoc)
library(arrow)
tic()
con <- DBI::dbConnect(duckdb::duckdb(), "data/pbp_db.duckdb")
nfl_pbp <- tbl(con, "nflfastR_pbp")
toc()
@junpenglao
junpenglao / theano-jax-test-drive.ipynb
Last active November 10, 2020 07:46
theano-jax test drive.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MattPD
MattPD / analysis.draft.md
Last active June 22, 2024 07:19
Program Analysis Resources (WIP draft)
@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
@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:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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',