Skip to content

Instantly share code, notes, and snippets.

View Jackliu91's full-sized avatar

Jiankun Liu Jackliu91

View GitHub Profile
@Jackliu91
Jackliu91 / add_only_ssh_user.sh
Created August 10, 2019 16:36
[add a restricted user] #bash
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Please enter username."
else
USERNAME=$1
PASSWD=$USERNAME
HOME=/home/$USERNAME
BIN_PATH=$HOME/bin
@Jackliu91
Jackliu91 / sort.py
Created January 24, 2019 03:39
[sort algrithm] #python
def selection_sort(arr):
for i in range(len(arr)):
index = i
for j in range(i + 1, len(arr)):
if arr[j] < arr[index]:
index = j
arr[i], arr[index] = arr[index], arr[i]
return arr
@Jackliu91
Jackliu91 / init.lua
Last active July 13, 2019 17:24
[Hammerspoon Config] my hammerspoon config file #lua
--varibles
ctrl_alt = {"control", "alt"}
ctrl_cmd = {"control", "cmd"}
alt_cmd = {"alt", "cmd"}
--reload
hs.hotkey.bind(ctrl_cmd, "R", function()
hs.reload()
hs.alert.show("Config loaded")
end)
@Jackliu91
Jackliu91 / vimrc
Last active December 18, 2015 05:49
This is my vim settings.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vundle settings
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'bling/vim-airline'
Plugin 'scrooloose/nerdtree'