Skip to content

Instantly share code, notes, and snippets.

View nauhygon's full-sized avatar

..o.n.o.. nauhygon

View GitHub Profile
@nauhygon
nauhygon / replace_str_all.sh
Last active January 17, 2024 22:45
Replace string in all .org files (recursively)
find . -type f -name "*.org" -exec sed -i '' 's/old/new/g' {} +
@nauhygon
nauhygon / wordle_help.py
Created March 6, 2022 17:37
Help me, Wordle! :-)
#!/usr/bin/env python
import sys
# Source: https://github.com/dwyl/english-words/blob/master/words_alpha.txt
WORD_FILE="words_alpha.txt"
def words_all(word_file=WORD_FILE):
lines = open(word_file).readlines()
@nauhygon
nauhygon / Build-Z3-with-MSYS2.org
Last active March 25, 2021 21:09
Steps to build Z3 and its Python bindings in MSYS2
  • Install x86_64-w64-mingw32 tools to build z3 & its Python bindings
  • Install mingw-w64-cross-binutils (to fix AR missing)
    • `pacman -S pacman -S mingw-w64-cross-binutils`
  • Explicitly add ‘.exe’ extension to CXX/CC/AR
    • and explicitly export them!
    • `export CXX=x86_64-w64-mingw32-g++.exe CC=x86_64-w64-mingw32-gcc.exe AR=x86_64-w64-mingw32-ar.exe`
  • Add /opt/bin to PATH
ffmpeg -i INPUT.MOV -c copy -reset_timestamps 1 -segment_time 160 -f segment OUTPUT%03d.MP4
# Func: Start an SSH tunnel (autossh) to a server $1 and map it to a
# local port $2 (default to 8888), which can be used as a SOCK. Start
# a HTTP proxy server (polipo) with proxy port $3 (default to 8123)
# and point it to the SSH tunnel.
#
# See also:
# autossh (http://www.harding.motd.ca/autossh/)
# polipo (https://www.irif.univ-paris-diderot.fr/~jch/software/polipo/)
#
# Usages:
@nauhygon
nauhygon / Build Emacs for Windows 64bit with Native Compilation.md
Last active April 26, 2024 06:03
Step-by-step instructions to build Emacs for Windows 64 bit with MSYS2 and MinGW-w64. Now `native-comp` supported.

Build Emacs-w64 with MSYS2/MinGW-w64 with Native Compilation

Instructions are modified from emacs-w64 Wiki page by zklhp. Many thanks for sharing!

  1. Download the latest MSYS2 from this download page.

  2. Install MSYS2 to, for example, C:\msys2 (make sure no space in path to avoid unwanted problems).

  3. Optionally prettify the MSYS2 console mintty with ~/.minttyrc to make it more pleasing to eyes. Thanks to this awesome theme!

@nauhygon
nauhygon / yahoo_login.html
Created January 21, 2012 17:55
Yahoo's login page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Sign in to Yahoo!</title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<script type='text/javascript'>
var startTime = new Date().getTime();