Skip to content

Instantly share code, notes, and snippets.

@jubnzv
jubnzv / Build Emacs for Windows 64bit.md
Created February 16, 2019 14:14 — forked from nauhygon/Build Emacs for Windows 64bit with Native Compilation.md
Step-by-step instructions to build Emacs for Windows 64 bit with MSYS2 and MinGW-w64.

Build Emacs-w64 with MSYS2/MinGW-w64

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

  1. Download MSYS2 (msys2-x86_64-20161025.exe) from this download page.

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

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

@jubnzv
jubnzv / sshrc_old.sh
Created January 21, 2019 08:14
sshrc that compatible with old `mktemp'.
#!/usr/bin/env bash
function sshrc() {
local SSHHOME=${SSHHOME:=~}
if [ -f $SSHHOME/.sshrc ]; then
local files=.sshrc
if [ -d $SSHHOME/.sshrc.d ]; then
files="$files .sshrc.d"
fi
SIZE=$(tar cfz - -h -C $SSHHOME $files | wc -c)
if [ $SIZE -gt 65536 ]; then
@jubnzv
jubnzv / drestivo-org-download-method.el
Created January 20, 2019 10:10 — forked from daviderestivo/drestivo-org-download-method.el
This is an helper function for org-download. It creates an \"./image\" folder within the same directory of the org file. Images are separated inside that image folder by additional folders one per org file.
(defun drestivo/org-download-method (link)
"This is an helper function for org-download.
It creates an \"./image\" folder within the same directory of the org file.
Images are separated inside that image folder by additional folders one per
org file.
More info can be found here: https://github.com/abo-abo/org-download/issues/40.
See the commit message for an example:
https://github.com/abo-abo/org-download/commit/137c3d2aa083283a3fc853f9ecbbc03039bf397b"
(let ((filename
(file-name-nondirectory
#!/usr/bin/env python3
#
# Usage example:
#
# echo "hello\nworld" > words.txt
# ./dict_generator.py > dict.md
# pandoc -s dict.md -o dict.doc
#
import bs4
import time
@jubnzv
jubnzv / sig_sync.c
Last active December 9, 2018 09:10
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>