This file contains hidden or 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/bash | |
| # usage: monssh [hostname] | |
| if [[ -z $1 ]] | |
| then | |
| HOST="YOURHOST" | |
| else | |
| HOST=$1 | |
| fi |
This file contains hidden or 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
| digraph { | |
| 思维导图 -> { OmniGraffle XMind dot }; | |
| OmniGraffle -> { 排版糟糕 单调 贵 }; | |
| XMind -> { 排版不错 主题好看 中文输入很麻烦 }; | |
| dot -> { 很强大 灵活 不适合现场演示 }; | |
| } |
This file contains hidden or 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
| diff --git a/osdep-darwin.c b/osdep-darwin.c | |
| index c5820df..7b15446 100644 | |
| --- a/osdep-darwin.c | |
| +++ b/osdep-darwin.c | |
| @@ -18,6 +18,7 @@ | |
| #include <sys/types.h> | |
| #include <sys/sysctl.h> | |
| +#include <libproc.h> |
This file contains hidden or 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
| (function () { | |
| var i, current, src, elem; | |
| var container = $$('.tpc_content')[0]; | |
| var inputs = $$('.tpc_content input'); | |
| for (i = 0; i < inputs.length; i++) { | |
| current = inputs[i]; | |
| src = current.onclick | |
| .toString() | |
| .match(/open\(".*"\)/)[0] |
This file contains hidden or 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
| # reference https://bitbucket.org/xuxiaodong/dotman/src/cb7f1e6fb338/.tmux.conf | |
| set -g default-terminal "screen-256color" | |
| set -g display-time 3000 | |
| set -g history-limit 65535 | |
| set -g base-index 1 | |
| set -g pane-base-index 1 | |
| set -s escape-time 0 | |
| # key bindings |
This file contains hidden or 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
| def compile_asset?(path) | |
| # ignores any filename that begins with '_' (e.g. sass partials) | |
| # all other css/js/sass/image files are processed | |
| if File.basename(path) =~ /^[^_].*\.\w+$/ | |
| puts "Compiling: #{path}" | |
| true | |
| else | |
| puts "Ignoring: #{path}" | |
| false | |
| end |
This file contains hidden or 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
| <?xml version='1.0'?> | |
| <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> | |
| <fontconfig> | |
| <match target="font"> | |
| <edit mode="assign" name="rgba"> | |
| <const>rgb</const> | |
| </edit> | |
| </match> |
This file contains hidden or 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
| function inMinutes(time) { | |
| return time.getHours() * 60 + time.getMinutes(); | |
| } | |
| function calcDuration(timeStart, timeEnd) { | |
| if (!timeStart || !timeEnd) { | |
| return ""; | |
| } | |
| var start = inMinutes(timeStart); |
This file contains hidden or 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
| module Mongoid | |
| module Finders | |
| # add find_by_xxx to Mongoid | |
| # from https://github.com/mitijain123/mongoid/commit/b28b360b787ba4cd32e5423afcfa3b83574f9df1 | |
| def method_missing(method_id, *args, &block) | |
| conditions = {} | |
| bang = false | |
| case method_id.to_s | |
| when /^find_(all|last||first)_?by_([_a-zA-Z]\w*)(!?)$/ |
This file contains hidden or 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/bash | |
| for i in {1..9999} | |
| do | |
| curl http://www.sysulove.com/lovetree/myapp/index.php/Friend/friendPersonalPage/friend_id/$i --cookie "<Paste your browser cookies here>" > $i.html | |
| sleep 0.5 | |
| done |