Skip to content

Instantly share code, notes, and snippets.

View appleshan's full-sized avatar
💭
抛弃世俗之浮躁,留我钻研之刻苦.

Alec Shan appleshan

💭
抛弃世俗之浮躁,留我钻研之刻苦.
View GitHub Profile
@fjpalacios
fjpalacios / arch-i3gaps-install.md
Last active June 22, 2024 21:11
Arch + i3-gaps Install Guide

Arch + i3-gaps Install Guide

First set up your keyboard layout. For example, in Spanish:

   # loadkeys es

For a list of all acceptable keymaps:

   # localectl list-keymaps
@geosharma
geosharma / conda_snippets.md
Last active December 9, 2023 15:31
conda command snippets

Conda and Anaconda commands

A list of conda commands that I regularly use but keep forgetting how to use

Update conda

conda update conda

Conda create a new environment with desired python verion

conda create --name envname python=pythonversion If no python=pythonversion is given it will install the default python version for the installed anaconda or conda

@lilydjwg
lilydjwg / gh-check
Last active March 18, 2024 04:43
gh-check: speed test to known GitHub IPs
#!/usr/bin/python3
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):
@cosven
cosven / .dir-locals.el
Last active November 21, 2018 07:57
Emasc Python 项目 .dir-locals.el 示例
((python-mode
;; 激活 pyvenv-mode,也可以自己在 init.el 中默认激活
(eval . (pyvenv-mode))
;; 这个要写绝对路径
(pyvenv-activate . "/Users/cosven/projectpath/.venv")
;; 默认 select python-pylint 这个 checker
;;
from itertools import islice
def next_n_lines(file_opened, N):
return [x.strip() for x in islice(file_opened, N)]
with open("samplefile", 'r') as f:
x = ""
while x != []:
@appleshan
appleshan / conda-env-autodetect.plugin.zsh
Created June 2, 2018 02:05 — forked from floringogianu/conda-env-autodetect.plugin.zsh
zsh plugin for autodetecting conda environments based on a .venv file in your project
# conda-env-autodetect.plugin.zsh
# Copy this file to ~/.oh-my-zsh/plugins/conda-env-autodetect/
# And make sure you have a .venv file with your env's name in your
# preject's root folder.
_conda_env_auto_activate() {
if [ -f ".venv" ]; then
# check conda is active
@fuxialexander
fuxialexander / helm-child-frame-display.el
Last active March 29, 2018 05:41
Override helm function to use child-frame
(defun my-helm-display-child-frame (buffer &optional resume)
"Display `helm-buffer' in a separate frame.
Function suitable for `helm-display-function',
`helm-completion-in-region-display-function'
and/or `helm-show-completion-default-display-function'.
See `helm-display-buffer-height' and `helm-display-buffer-width' to
configure frame size."
(if (not (display-graphic-p))
@kissge
kissge / emacs26.sh
Created December 3, 2017 13:24
Compile Emacs 26 on Ubuntu 16.04 on Windows Subsystem for Linux (WSL, aka Bash on Ubuntu on Windows)
mkdir emacs
cd emacs
git init
git remote add origin https://github.com/emacs-mirror/emacs.git
git fetch --depth 1 origin emacs-26
git reset --hard FETCH_HEAD
sudo apt install autoconf make gcc texinfo libgtk-3-dev libxpm-dev libjpeg-dev libgif-dev libtiff5-dev libgnutls-dev libncurses5-dev
./configure
make
sudo make install
@okorz001
okorz001 / emacs-gnutls-windows.txt
Created October 11, 2017 06:10
Installing GnuTLS for Emacs on Windows for downloading packages over HTTPS
Download Emacs dependencies from GNU for your architecture:
http://ftp.gnu.org/gnu/emacs/windows/emacs-25-x86_64-deps.zip
http://ftp.gnu.org/gnu/emacs/windows/emacs-25-i686-deps.zip
The following DLLs need to be installed into Emacs's bin directory:
libffi-6.dll
libgmp-10.dll
libgnutls-30.dll
@geosharma
geosharma / arch_installation_btrfs.md
Last active November 30, 2021 12:14
Arch Linux installation: BIOS, GPT, Encrypted btrfs root, xfs home

Notes on Arch Linux installation

Key features:

BIOS, GPT, encryption, btrfs, xfs. encrypted btrfs root, unencrypted xfs /home

This was created to document the procedures followed during the installation of Arch Linux. This is intended to act as a guide in the event a full installation is required in the future. This is primarily for my own use. I plan to document each step with code. If anyone finds this helpful, then please use it at your own risk, I assume no responsibility for any damage incurred from following these notes. I would recommend that you follow the Arch Linux Installation Guide and the Arch Linux wikis, rather than these set of notes.

Setup

  • Computer: HP DV6000
  • Hard disk: 230 SSD