Skip to content

Instantly share code, notes, and snippets.

View xukai92's full-sized avatar
😼
Feeling cool

Kai Xu xukai92

😼
Feeling cool
View GitHub Profile
@jthaman
jthaman / consult-ripgrep-all.el
Last active April 10, 2024 01:09
Call ripgrep-all in emacs with consult
;; Note: put `rga' in your PATH. -*- lexical-binding: t; -*-
(require 'consult)
(defcustom consult-ripgrep-all-args
"rga --null --line-buffered --color=never --max-columns=1000 --path-separator /\ --smart-case --no-heading --with-filename --line-number"
"Command line arguments for ripgrep, see `consult-ripgrep-all'.
The dynamically computed arguments are appended.
Can be either a string, or a list of strings or expressions."
:type '(choice string (repeat (choice string expression))))
@chriselsner
chriselsner / nix-on-macos-catalina.md
Last active September 19, 2024 00:46
Nix on macOS Catalina

Nix on macOS Catalina

I'm writing this gist for my own records but it might help someone else too.

Installing Nix

Support for Catalina has improved a lot since the update was first rolled out.

Note: See the NixOS manual for discussion of the --darwin-use-unencrypted-nix-store-volume option.

@tap52384
tap52384 / README.md
Last active August 23, 2024 08:27
Install Windows on External Drive for macOS
@koshatul
koshatul / README.md
Last active October 9, 2024 07:06
use Apple Keychain to store GPG Passphrases

gpg-agent setup

Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)

$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *
@yzh119
yzh119 / st-gumbel.py
Created January 12, 2018 12:25
ST-Gumbel-Softmax-Pytorch
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
def sample_gumbel(shape, eps=1e-20):
U = torch.rand(shape).cuda()
return -Variable(torch.log(-torch.log(U + eps) + eps))
@marcusramberg
marcusramberg / -
Last active April 9, 2024 09:45
kitty.conf including nord color theme
# vim:fileencoding=utf-8:ft=conf
# Fully featured
font_family FuraCode Nerd Font Mono
italic_font auto
bold_font auto
bold_italic_font auto
# Font size (in pts)
font_size 11.0
@eamartin
eamartin / notebook.ipynb
Last active November 6, 2022 18:53
Understanding & Visualizing Self-Normalizing Neural Networks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.