This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def createIndexFile(startpath, indexFile): | |
for root, dirs, files in os.walk(startpath): | |
files = [f for f in files if not (f[0] == '.' or f[0] == '_')] | |
dirs[:] = [d for d in dirs if not (d[0] == '.' or d[0] == '_')] | |
level = root.replace(startpath, '').count(os.sep) - 1 | |
indent = ' ' * 2 * (level) | |
directory = os.path.basename(root) | |
if directory != '.': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; org-archive-subtree-hierarchical.el | |
;; modified from https://lists.gnu.org/archive/html/emacs-orgmode/2014-08/msg00109.html | |
;; In orgmode | |
;; * A | |
;; ** AA | |
;; *** AAA | |
;; ** AB | |
;; *** ABA | |
;; Archiving AA will remove the subtree from the original file and create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_proxychains(){ | |
local old="$READLINE_LINE" | |
local cmd="proxychains $old" | |
history -a $old | |
$cmd | |
READLINE_LINE="" | |
} | |
bind -x '"\C-[": _proxychains' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Insall WenQuanYi Micro Hei | |
* | |
:not [class*="code"] > * | |
{ | |
font-family: "FontAwesome", "octicons", "icon","Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "WenQuanYi Micro Hei" !important; | |
} | |
[class*="code"] > * | |
{ | |
font-family: "WenQuanYi Micro Hei Mono" !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Run emacsclient in the gui with emacs --daemon | |
exec emacsclient -c -n -F '((fullscreen . maximized) (font . "Ubuntu Mono derivative Powerline-18"))' "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# | |
# Description: | |
# Make your local folder to remote server synchronization. | |
# Requirements: | |
# brew install fswatch | |
SRC=/Users/liuxd/Documents/guess_cheat_new/ | |
[email protected]:/home/liuxidong/project/cheat/ | |
EXCLUDE=/Users/liuxd/Downloads/rsync-exlcude.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on idle | |
tell application "System Events" | |
tell current location of network preferences | |
-- check vpn connection status | |
set connected_vpn to get name of every service whose (kind is greater than 10 and kind is less than 17) and connected of current configuration is true | |
set connect_status to count of connected_vpn | |
if connect_status is 0 then | |
-- get vpn list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch: | |
while true; do \ | |
<what you want to do> \ | |
inotifywait -qre close_write .; \ | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This piece is taken from: | |
;; http://sachachua.com/blog/2007/12/clocking-time-with-emacs-org/ | |
(eval-after-load'org | |
'(progn | |
(defun wicked/org-clock-in-if-starting () | |
"Clock in when the task is marked STARTED." | |
(when (and (string= org-state "STARTED") | |
(not (string= org-last-state org-state))) | |
(org-clock-in))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SCHEDULED:%(org-insert-time-stamp (org-read-date nil t) nil nil nil nil \" .+1d\") |