Xcode 4.6 或以上
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
| bundle exec gem list --no-versions | grep -v bundler | grep -v rake | xargs -n1 bundle exec gem pristine |
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
| #!/usr/bin/env ruby | |
| require 'date' | |
| DBS = %w( depot_development ) | |
| USER = "root" # Username with rights to all those databases, might be root | |
| PW = "123456" # Password for that username | |
| today_s = Date.today().to_s | |
| yesterday_s = (Date.today()-(2)).to_s |
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
| require 'digest' | |
| Digest::SHA256.file("upload.rb").hexdigest |
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
| require 'formula' | |
| # Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook | |
| # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST! | |
| class TmuxForIterm2 < Formula | |
| homepage 'https://code.google.com/p/iterm2/downloads/detail?name=tmux-for-iTerm2-20130319.tar | |
| url 'https://iterm2.googlecode.com/files/tmux-for-iTerm2-20130319.tar.gz' | |
| sha1 'f14a0bad6991b9e3380d5c3a6057e09f62597d1f' |
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
| var fs = require('fs'); | |
| var http = require('http'); | |
| var util = require('util'); | |
| var url = require('url'); | |
| http.createServer(function (req, res) { | |
| var options = url.parse(req.url); | |
| var req_headers = req.headers; | |
| req_headers["connection"] = "close"; | |
| var req_options = { |
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
| #!/usr/bin/env python | |
| #coding=cp936 | |
| import win32com | |
| from win32com.client import Dispatch, constants | |
| import os | |
| import sys | |
| def doc2pdf(input, output): | |
| w = win32com.client.DispatchEx("Word.Application") |
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
| // Get a reference to the link and bind the showHide function to it | |
| toggle = document.getElementById('toggle'); | |
| if (toggle.addEventListener) { | |
| // modern browsers | |
| toggle.addEventListener('click', showHide, false); | |
| } else if (toggle.attachEvent) { | |
| // IE 8 and earlier | |
| toggle.attachEvent('onclick', showHide); | |
| } |
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
| exports.concat = function() { | |
| var args = (arguments.length === 1) ? arguments[0] : arguments; | |
| var i; | |
| var sumlen = 0; | |
| for (i = 0; i < args.length; i++) { | |
| sumlen += args[i].length; | |
| } | |
| var buf = new Buffer(sumlen); |
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
| var connect = require('connect') | |
| , http = require('http'); | |
| var app = connect() | |
| .use(connect.logger('dev')) | |
| .use(connect.static('/Users/hhuai/Downloads')) | |
| .use(connect.directory('/Users/hhuai/Downloads')); | |
| http.createServer(app).listen(3000); |