Skip to content

Instantly share code, notes, and snippets.

@huytd
huytd / customize.material-dark-theme.md
Last active September 2, 2023 13:03
My minimal Emacs config

;; Automatically generated
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(anzu-cons-mode-line-p nil)
@aschmu
aschmu / pypi-mirror.md
Last active May 2, 2024 12:34
Setting up a PyPi mirror

I) Introduction

Taken from: [https://groups.google.com/forum/#!topic/devpi-dev/S-3ioWILTiY]).

We wanted to do some python developpement but we had a problem : our working network is completely isolated from any internet access, only having servers providing services like distribution packages repository mirror and web servers. The question then was how to make a full pypi mirror for usig pip install and pip search.

This is possible to be done using devpi, a web server, bandersnatch and an external hard drive. The idea is to dump all pypi packages with bandersnatch, transfer them to the server with the hard drive,

@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active April 24, 2024 00:11
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@VitoVan
VitoVan / org-table-align.el
Last active January 28, 2024 12:15
如果你在 orgmode 中使用 table 表格,然后设置了固定宽度 width,然后发现长段落中文隐藏后无法对齐了,那么你可以重定义 org-table-align 函数,以实现中文对齐。
(defun org-table-align ()
"Align the table at point by aligning all vertical bars."
(interactive)
(let* (
;; Limits of table
(beg (org-table-begin))
(end (org-table-end))
;; Current cursor position
(linepos (org-current-line))
(colpos (org-table-current-column))
@bskinn
bskinn / intersphinx_mappings.txt
Last active May 31, 2024 17:54
Various intersphinx mappings
# The entries in this file are checked regularly for validity via the Github Action
# sited at github.com/bskinn/intersphinx-gist.
# Please feel free to post an issue at that repo if any of these mappings don't work for you,
# or if you're having trouble constructing a mapping for a project not listed here.
Python 3 [latest]: ('https://docs.python.org/3/', None)
Python 3 [3.x]: ('https://docs.python.org/3.9/', None)
attrs [stable]: ('https://www.attrs.org/en/stable/', None)
Django [dev]: ('https://docs.djangoproject.com/en/dev/', 'https://docs.djangoproject.com/en/dev/_objects/')
Flask [2.2.x]: ('https://flask.palletsprojects.com/en/2.2.x/', None)
@squarism
squarism / iterm2.md
Last active June 2, 2024 09:59
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
@leommoore
leommoore / file_magic_numbers.md
Last active May 31, 2024 11:11
File Magic Numbers

File Magic Numbers

Magic numbers are the first bits of a file which uniquely identify the type of file. This makes programming easier because complicated file structures need not be searched in order to identify the file type.

For example, a jpeg file starts with ffd8 ffe0 0010 4a46 4946 0001 0101 0047 ......JFIF.....G ffd8 shows that it's a JPEG file, and ffe0 identify a JFIF type structure. There is an ascii encoding of "JFIF" which comes after a length code, but that is not necessary in order to identify the file. The first 4 bytes do that uniquely.

This gives an ongoing list of file-type magic numbers.

Image Files

@miki725
miki725 / .bash_prompt.sh
Last active April 5, 2024 00:04
Custom bash prompt which displays: (virtualenv) user:/path (git-branch)
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch of the current git/mercurial repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@Superbil
Superbil / fix-font-org-mode.el
Last active August 27, 2022 08:25
fix chinese font on Emacs
;;; base on https://gist.github.com/coldnew/7398835
(defvar emacs-english-font nil
"The font name of English.")
(defvar emacs-cjk-font nil
"The font name for CJK.")
(defvar emacs-font-size-pair nil
"Default font size pair for (english . chinese)")
先做好硬碟分割
PS. 本人指令功力不足(掩面),我會先藉助Gparted圖形介面分割軟體做好分割,分割後記得等等要安裝的分割區代號(像是/dev/sda3那種)
掛載要安裝的分割區
$ mount /dev/sda3 /mnt #我是安裝在sda3分割區
$ dhcpcd #開啟有線網路自動抓取IP
$ pacstrap /mnt base base-devel #安裝Linuix所需基本檔案環境
產生需要的自動掛載設定檔
$ genfstab -p /mnt >> /mnt/etc/fstab