警告: 請絕對不要跳著裝!
- Software Update
- Install Xcode ( Mac OS X Install CD 那一塊的 >> 選擇安裝)
- Install Homebrew http://github.com/mxcl/homebrew
| #!/bin/sh | |
| # | |
| # git autodeploy script when it matches the string "[deploy]" | |
| # | |
| # @author icyleaf <icyleaf.cn@gmail.com> | |
| # @link http://icyleaf.com | |
| # @version 0.1 | |
| # | |
| # Usage: | |
| # 1. put this into the post-receive hook file itself below |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
警告: 請絕對不要跳著裝!
| // `then` isn't chainable, so we use `pipe`, which also accepts a 2nd callback for failure filters | |
| // http://api.jquery.com/deferred.pipe/ | |
| $.Deferred(function(dfr) { | |
| dfr | |
| .pipe(function() { $('.first').fadeIn() }) | |
| .pipe(function() { $('.second').fadeIn() }) | |
| .pipe(function() { $('.third').fadeIn() }) | |
| }).resolve() |
| from geventwebsocket.handler import WebSocketHandler | |
| from gevent.pywsgi import WSGIServer | |
| from flask import Flask, request, render_template | |
| app = Flask(__name__) | |
| @app.route('/') | |
| def index(): | |
| return render_template('index.html') |
| var css = 'insert lots of css here'; | |
| var files = {}; | |
| css = css.replace(/url\((\S*)\.(png|jpg|jpeg|gif)\)/g, function(match, file, type) | |
| { | |
| var fileName = file + '.' + type; | |
| var size = fs.statSync(fileName).size; | |
| if (size > 4096) { | |
| console.log('Skipping ' + fileName + ' (' + (Math.round(size/1024*100)/100) + 'k)'); | |
| return match; |
| class PostsController < ActionController::Base | |
| def create | |
| Post.create(post_params) | |
| end | |
| def update | |
| Post.find(params[:id]).update_attributes!(post_params) | |
| end | |
| private |
| <html> | |
| <body> | |
| <input id="msg" type="text"> | |
| <input id="send" type="button" value="send"> | |
| <input id="file" type="file"> | |
| <div id="panel" style="border:solid 1px #336699"></div> | |
| <div id="info" style="border:solid 1px #336699"></div> | |
| <div id="img"><img id="imgtarget"></div> | |
| </body> | |
| </html> |
| import re | |
| at_user_filter = re.compile(r'(?:^|\W)@(\w+)') | |
| email_filter = re.compile('(\w{1,63})@([A-Za-z0-9\.\-] ).(com|net|org|me|in|fm|co|biz|info|mobi|cc)') | |
| #you can add suffixes by asking Google for domain suffix information. | |
| url_filter = re.compile(u'((http(s|)|ftp)://|)(\w{0,}\.|)(\w{1,63}).(\w{2,4})((/((.*)|)|))') |