Skip to content

Instantly share code, notes, and snippets.

View naturale0's full-sized avatar

Sihyung Park naturale0

View GitHub Profile
@matteodelabre
matteodelabre / 1-monitor_wlan0_ip.sh
Last active December 3, 2021 03:30
Display wlan0 IP address on screen on reMarkable
#!/usr/bin/env bash
# /home/root/monitor_wlan0_ip.sh
iface=wlan0
get_dbus_iface() {
dbus-send --system --dest=fi.w1.wpa_supplicant1 --print-reply=literal \
/fi/w1/wpa_supplicant1 \
fi.w1.wpa_supplicant1.GetInterface \
"string:$iface" \
| sed 's/^ *//g'
import itertools
import torch
from torchtext.experimental.datasets.translation import DATASETS, TranslationDataset
from torchtext.vocab import build_vocab_from_iterator
from torchtext.experimental.functional import (
vocab_func,
totensor,
sequential_transforms,
)
from torchtext.data.utils import get_tokenizer
@agramfort
agramfort / lowess.py
Last active August 16, 2023 06:19
LOWESS : Locally weighted regression
"""
This module implements the Lowess function for nonparametric regression.
Functions:
lowess Fit a smooth nonparametric regression curve to a scatterplot.
For more information, see
William S. Cleveland: "Robust locally weighted regression and smoothing
scatterplots", Journal of the American Statistical Association, December 1979,
@omz
omz / touchid.py
Last active November 15, 2023 23:35 — forked from alessaba/TouchID.py
TouchID.py
# coding: utf-8
from objc_util import *
import threading
NSBundle = ObjCClass('NSBundle')
LocalAuthentication = NSBundle.bundleWithPath_('/System/Library/Frameworks/LocalAuthentication.framework')
LocalAuthentication.load()
LAContext = ObjCClass('LAContext')
# authenticate() will raise one of these exceptions when authentication
@HarshTrivedi
HarshTrivedi / pad_packed_demo.py
Last active March 2, 2024 16:49 — forked from Tushar-N/pad_packed_demo.py
Minimal tutorial on packing (pack_padded_sequence) and unpacking (pad_packed_sequence) sequences in pytorch.
import torch
from torch import LongTensor
from torch.nn import Embedding, LSTM
from torch.autograd import Variable
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
## We want to run LSTM on a batch of 3 character sequences ['long_str', 'tiny', 'medium']
#
# Step 1: Construct Vocabulary
# Step 2: Load indexed data (list of instances, where each instance is list of character indices)
@gatopeich
gatopeich / install_Jupyter.sh
Last active March 29, 2024 22:10
Install Jupyter iPython Notebook on Android via Termux
pkg upgrade
# Install runtime deps
pkg install python libzmq libcrypt
# Add build deps
pkg install python-dev libzmq-dev libcrypt-dev clang
pip3 install -U pip
pip3 install pyzmq --install-option="--zmq=/usr/lib"
pip3 install jupyter
@peterhurford
peterhurford / install_xelatex_on_mac.txt
Last active April 16, 2024 04:20
How to install latex and xelatex on Mac so that Jupyter "Download as PDF" will work
brew install pandoc
brew tap homebrew/cask
brew install --cask basictex
eval "$(/usr/libexec/path_helper)"
# Update $PATH to include `/usr/local/texlive/2022basic/bin/universal-darwin`
sudo tlmgr update --self
sudo tlmgr install texliveonfly
sudo tlmgr install xelatex
sudo tlmgr install adjustbox
sudo tlmgr install tcolorbox
@Saren-Arterius
Saren-Arterius / Waydroid.sh
Last active April 17, 2024 14:06
Install Waydroid on Steam Deck (As of 2024-03-16)
#!/bin/sh
cage -- bash -c 'wlr-randr --output X11-1 --custom-mode 1280x800; sleep 1; sudo /usr/local/bin/waydroid-helper & waydroid show-full-ui'
@gdurastanti
gdurastanti / parallels-reset.sh
Created August 9, 2017 14:00
Reset Parallels' trial
#!/bin/sh
# Reset Parallels Desktop's trial and generate a casual email address to register a new user
rm /private/var/root/Library/Preferences/com.parallels.desktop.plist /Library/Preferences/Parallels/licenses.xml
jot -w pdu%d@gmail.com -r 1
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 23, 2024 15:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname