Skip to content

Instantly share code, notes, and snippets.

View wotori's full-sized avatar
🛠️
Ship or Die

Wotori Movako wotori

🛠️
Ship or Die
View GitHub Profile
@rubo77
rubo77 / rotatescreen.sh
Last active April 2, 2025 08:31
This script rotates the screen (tested on a Lenovo Yoga 730-15iwl) (source: https://askubuntu.com/a/1217290/34298)
#!/bin/bash
# This script rotates the screen and touchscreen
# by Ruben Barkow-Kuder: https://gist.github.com/rubo77/daa262e0229f6e398766
#### configuration
# find your Touchscreen device with `xinput`
TouchscreenDevice="$(xrandr |grep eDP|cut -d" " -f1)"
if [ "$1" = "--help" ] || [ "$1" = "-h" ] ; then
@peterhurford
peterhurford / install_xelatex_on_mac.txt
Last active October 6, 2025 16:25
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
@uliang
uliang / states.py
Last active February 8, 2024 23:03
Implementation of State Design Pattern in python
"""
Simple implementation of a finite state machine.
Author: Tang U-Liang
Date: 2 Oct 2020
"""
import attr
from enum import Enum
import inspect
@sowwic
sowwic / Instructions.txt
Last active January 12, 2022 12:45
Ubuntu 20.04 - Maya 2020 installation
1)Get the packages required for converting the rpm package.
sudo apt-get install alien dpkg-dev debhelper build-essential zlib1g-dev
2)Get and install libXp6.
sudo add-apt-repository ppa:zeehio/libxp
sudo apt-get update
sudo apt-get install libxp6
3) Extract the contents of the Maya installation package and change directory to its install/Packages directory.
@hendi
hendi / rocket-sqlx.rs
Last active September 7, 2024 20:02
Rust: rocket with sqlx
#[macro_use] extern crate rocket;
use std::env;
use anyhow::Result;
use rocket::State;
use rocket::http::Status;
use sqlx::{Pool, Postgres};
@mortenbh
mortenbh / Install_Maya_2020_Arnold_Bifrost_on_Ubuntu_Focal_Fossa_(20.04).md
Created December 23, 2020 17:14
Install Maya 2020, Arnold and Bifrost on Ubuntu Focal Fossa (20.04)

Download and install dependencies

sudo apt install wget alien libjpeg62 libcurl4 libaudiofile1 libtinfo5 python mesa-opencl-icd xfonts-100dpi xfonts-75dpi

wget http://ftp.br.debian.org/debian/pool/main/o/openssl1.0/libssl1.0.2_1.0.2u-1~deb9u1_amd64.deb
wget https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/33/Everything/x86_64/os/Packages/l/libpng15-1.5.30-11.fc33.x86_64.rpm

fakeroot alien -vc libpng15-1.5.30-11.fc33.x86_64.rpm

Ubuntu20.04 Wine 6.0 微信中文显示方块/方框

如果希望在Ubuntu使用Windows版微信:

  1. 安装 Wine sudo apt-get install wine
  2. 先把环境改了省事:
    $ export WINEARCH=win32
    $ export WINEPREFIX=/home/qinyu/Wine/WeChat
  3. 创建 Wine Bottle
@octalmage
octalmage / keplr.js gist
Last active September 19, 2022 16:49 — forked from clevinson/keplr.js gist
DO NOT RUN THIS
{
"chainId": "phoenix-1",
"chainName": "Terra 2.0",
"rpc": "https://terra-rpc.polkachu.com/",
"rest": "https://phoenix-lcd.terra.dev/",
"stakeCurrency": {
"coinDenom": "LUNA",
"coinMinimalDenom": "uluna",
"coinDecimals": 6,
"coinGeckoId": "terra-luna"
@vrslev
vrslev / main.py
Last active September 15, 2025 02:36
Automatic browser reloading in FastAPI
import os
import arel
from fastapi import FastAPI, Request
from fastapi.templating import Jinja2Templates
app = FastAPI()
templates = Jinja2Templates("templates")
if _debug := os.getenv("DEBUG"):
def is_valid(grid, r, c, k):
not_in_row = k not in grid[r]
not_in_column = k not in [grid[i][c] for i in range(9)]
not_in_box = k not in [grid[i][j] for i in range(r//3*3, r//3*3+3) for j in range(c//3*3, c//3*3+3)]
return not_in_row and not_in_column and not_in_box
def solve(grid, r=0, c=0):
if r == 9:
return True