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
find '/pillar/Lab/' -mindepth 1 -maxdepth 1 -type d | | |
while read file | |
do | |
alias ${file##*/}="'cd $file'" | |
done | |
目的: | |
如果存在 /pillar/Lab/hi 目录,则 | |
alias hi='cd /pillar/Lab/hi' |
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
find '/pillar/Lab/' -mindepth 1 -maxdepth 1 -type d | | |
while read file | |
do | |
eval "alias ${file##*/}='cd $file'" | |
done | |
if there is a directory named /pillar/Lab/hi | |
I want this script exec alias hi='cd /pillar/Lab/hi' |
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
for d in /pillar/Lab/*; do | |
if [ -d $d ];then | |
alias ${d##*/}="cd '$d'"; | |
fi | |
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
$.fn.ajaxLink = function() { | |
$(this).click(function(){ | |
$.ajax({ | |
url: $(this).attr('href'), | |
dataType: 'script', | |
}); | |
return false; | |
}); | |
}; | |
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
# Begin /etc/nsswitch.conf | |
passwd: files | |
group: files | |
shadow: files | |
publickey: files | |
hosts: files dns | |
networks: files |
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
require 'rubygems' | |
require 'sinatra' | |
require 'rack/contrib' | |
use Rack::Callbacks | |
def before | |
content_type 'text/plain',:charset => 'utf-8' | |
end |
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
require 'rubygems' | |
require 'sinatra' | |
require 'rack/contrib' | |
class MyApp < Sinatra::Default | |
get '/' do | |
'main app!' | |
end | |
end | |
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
!! Unexpected error while processing request: wrong number of arguments (1 for 0) | |
wrong number of arguments (1 for 0) | |
/usr/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/builder.rb:38:in `initialize' | |
/usr/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/builder.rb:38:in `new' | |
/usr/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/builder.rb:38:in `use' | |
/usr/lib/ruby/gems/1.8/gems/thin-1.0.0/lib/thin/connection.rb:63:in `call' | |
/usr/lib/ruby/gems/1.8/gems/thin-1.0.0/lib/thin/connection.rb:63:in `pre_process' | |
/usr/lib/ruby/gems/1.8/gems/thin-1.0.0/lib/thin/connection.rb:54:in `process' | |
/usr/lib/ruby/gems/1.8/gems/thin-1.0.0/lib/thin/connection.rb:39:in `receive_data' | |
/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.6/lib/eventmachine.rb:240:in `run_machine' |
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
-module('area'). | |
-export([start/0,area/2]). | |
start() -> spawn(fun loop/0). | |
area(Pid,What) -> rpc(Pid,What). | |
rpc(Pid,Request) -> | |
Pid ! {self(),Request}, | |
receive |
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/ruby | |
# vim: fileencoding=utf-8 | |
require 'rubygems' | |
require 'zipruby' | |
require 'openssl' | |
require 'digest/sha1' | |
require 'optparse' | |
require 'fileutils' | |
require 'find' |
OlderNewer