Skip to content

Instantly share code, notes, and snippets.

View xcodebuild's full-sized avatar
💭
Busy

xcodebuild xcodebuild

💭
Busy
View GitHub Profile
;; How to use:
;; 1. add `(load"/path/to/next-spec-day")` to your dot emacs file.
;; 2. set `NEXT-SPEC-DEADLINE` and/or `NEXT-SPEC-SCHEDULED` property of a TODO task,like this:
;; * TODO test
;; SCHEDULED: <2013-06-16 Sun> DEADLINE: <2012-12-31 Mon -3d>
;; :PROPERTIES:
;; :NEXT-SPEC-DEADLINE: (= (calendar-extract-day date) (calendar-last-day-of-month (calendar-extract-month date) (calendar-extract-year date)))
;; :NEXT-SPEC-SCHEDULED: (org-float 6 0 3)
;; :END:
;; The value of NEXT-SPEC-DEADLINE will return `non-nil` if `date` is last day of month,and the value of NEXT-SPEC-SCHEDULED will return `non-nil` if `date` is the fathers'day(the third Sunday of June).
@xcodebuild
xcodebuild / org-capture-templates-schedule.el
Created August 12, 2015 02:04
org-capture-templates to schedule a TODO for repeat
SCHEDULED:%(org-insert-time-stamp (org-read-date nil t) nil nil nil nil \" .+1d\")
;; 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)))
@xcodebuild
xcodebuild / makefile
Created August 18, 2015 09:01
Makefile watch for file
watch:
while true; do \
<what you want to do> \
inotifywait -qre close_write .; \
done
@xcodebuild
xcodebuild / gist:59f151597cc9110f618a
Created November 24, 2015 02:07
Applescript to keep vpn connect
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
@xcodebuild
xcodebuild / fswatch-rsync.sh
Created December 2, 2015 08:36
fswatch + rsync.
#!/usr/bin/env sh
#
# Description:
# Make your local folder to remote server synchronization.
# Requirements:
# brew install fswatch
SRC=/Users/liuxd/Documents/guess_cheat_new/
DES=liuxidong@172.16.0.37:/home/liuxidong/project/cheat/
EXCLUDE=/Users/liuxd/Downloads/rsync-exlcude.txt
@xcodebuild
xcodebuild / ec.sh
Created December 10, 2015 13:38
A shell script to run emacsclient with Emacs GUI daemon
#!/bin/sh
# Run emacsclient in the gui with emacs --daemon
exec emacsclient -c -n -F '((fullscreen . maximized) (font . "Ubuntu Mono derivative Powerline-18"))' "$@"
// 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;
_proxychains(){
local old="$READLINE_LINE"
local cmd="proxychains $old"
history -a $old
$cmd
READLINE_LINE=""
}
bind -x '"\C-[": _proxychains'
@xcodebuild
xcodebuild / org-archive-subtree-hierarchical.el
Last active January 13, 2019 16:24
Keeping the context when archiving in Emacs org-mode
;; 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