Skip to content

Instantly share code, notes, and snippets.

View sailxjx's full-sized avatar
🚀
Launching

Xu Jingxin sailxjx

🚀
Launching
View GitHub Profile
@sailxjx
sailxjx / .git-prompt.sh
Created July 11, 2018 01:50 — forked from nbrew/.git-prompt.sh
My latest bash prompt customization. Colored Git bash prompt.
#!/bin/bash
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# If you don't already have git-completion installed:
#
# cd ~/
# curl -OL https://github.com/git/git/raw/master/contrib/completion/git-completion.bash
# mv ~/git.completion.bash ~/.git-completion.bash
@sailxjx
sailxjx / dailyga
Last active August 29, 2015 14:20
Deploy your application automatically
#!/bin/bash
DIR=$1
if [[ "$DIR" == '' ]] || [[ $DIR == '-h' ]] || [[ $DIR == '--help' ]]; then
cat <<EOF
Usage: dailyga your-repos-directory
Options:
@sailxjx
sailxjx / macgap
Last active August 29, 2015 14:05
macgap
#MacGap
The MacGap project aims to provide HTML/JS/CSS developers an Xcode project for developing Native OSX Apps that run in OSX's WebView and take advantage of WebKit technologies. The project also exposes a basic JavaScript API for OS integration, such as display Growl notifications. The MacGap project is extremely lightweight and nimble, a blank application is about 0.3mb.
##Pre-requisites
MacGap works on OSX 10.6 and 10.5.
Generate apps with the [macgap generator](http://github.com/maccman/macgap-rb), no compile necessary.
@sailxjx
sailxjx / Aqper.markdown
Created April 23, 2014 09:02
A Pen by Xu Jingxin.
@sailxjx
sailxjx / acv_multi.rb
Last active December 16, 2015 06:48
four keys question, multi_keys
class AcvMulti
def initialize(totalNum)
@totalNum = totalNum
@stepNum = 0
@stepList = [] # each steps by the quickest route
@cmdList = [:x, :ctrl, :a, :c, :v]
@primes = {}
end
@sailxjx
sailxjx / acv.rb
Last active December 16, 2015 05:59
four keys question
class Acv
def initialize(totalNum)
@totalNum = totalNum
@stepNum = 0
@stepList = [] # each steps by the quickest route
@cmdList = [:a, :ca, :cc, :cv]
@primes = {2=>{"num"=>2, "list"=>[:a, :a]}, 3=>{"num"=>3, "list"=>[:a, :a, :a]}, 5=>{"num"=>5, "list"=>[:a, :a, :a, :a, :a]}, 7=>{"num"=>7, "list"=>[:a, :a, :a, :a, :a, :a, :a]}, 11=>{"num"=>10, "list"=>[:a, :a, :a, :ca, :cc, :cv, :cv, :cv, :a, :a]}, 13=>{"num"=>10, "list"=>[:a, :a, :a, :a, :ca, :cc, :cv, :cv, :cv, :a]}, 17=>{"num"=>11, "list"=>[:a, :a, :a, :a, :ca, :cc, :cv, :cv, :cv, :cv, :a]}, 19=>{"num"=>12, "list"=>[:a, :a, :a, :a, :a, :a, :ca, :cc, :cv, :cv, :cv, :a]}, 23=>{"num"=>14, "list"=>[:a, :a, :a, :a, :a, :ca, :cc, :cv, :cv, :cv, :cv, :a, :a, :a]}, 29=>{"num"=>14, "list"=>[:a, :a, :a, :a, :a, :a, :a, :ca, :cc, :cv, :cv, :cv, :cv, :a]}, 31=>{"num"=>14, "list"=>[:a, :a, :a, :a, :a, :a, :ca, :cc, :cv, :cv, :cv, :cv, :cv, :a]}, 37=>{"num"=>15, "list"=>[:a, :a, :a, :a, :a, :a, :ca, :cc, :cv, :cv, :cv, :cv, :cv, :cv, :a]}, 41=>{"n