Skip to content

Instantly share code, notes, and snippets.

View kevin-shu's full-sized avatar

Kevin Shu kevin-shu

  • Apple Buds, Inc.
  • Taiwan
View GitHub Profile
  1. 30 秒認識 vagrant:

Vagrant 是一個 ruby 寫的工具,它是一個 DSL 讓開發者可以輕易控制 VirtualBox 的 VM 。用它可以輕鬆管理和制作我們理想中的開發環境。

  $ gem install vagrant #安裝 vagrant
  $ vagrant box add ubuntu http://cloud-images.ubuntu.com/vagrant/quantal/current/quantal-server-cloudimg-i386-vagrant-disk1.box #安裝新的 Vagrant Package。這裡的 ubuntu 是一個預先做好的空的 ubuntu 12.10 (intel-based) 
  $ vagrant init ubuntu  
  $ vagrant up  

此時就可以使用 vangrant ssh 連到vm了,預設使用者/密碼為 vangrant/vangrant

The Problem

If you have installed the standalone Command Line Tools for XCode on your Mac (i.e. without having XCode.app installed), some of these tools can get a bit confused due to a couple of oversights on Apple's part in finalising the setup.

Note: all commands below will need to be run from an Administrator account, or by an account with appropriate permission in /etc/sudoers.

The Solution

1. Failing to Find Frameworks

Sometime when compiling against the preinstalled Frameworks (e.g. Ruby or Python), various tools will inexplicable fail to find header files that are quite clearly there. This is caused by the fact that no XCode has been selected for the command-line tools. Wait, I hear you cry, I don't have XCode installed! Indeed, but you nonetheless need to select one, and point it somewhere where the command line tools exist, like so

app_root = "/root/path/of/app"
app_name = "demoapp"
listen "/tmp/app.sock", :backlog => 2048 #這邊要跟nginx虛擬主機檔中upstream內定義的務必一樣
worker_processes 4 #看情況開
preload_app false
timeout 30
module Rails
class <<self
def root
# sudo ln -s ~/nginx.conf unicorn.conf
upstream app_server {
server unix:/tmp/unicorn_padrino.sock fail_timeout=0;
}
server {
listen 80;
charset utf-8;
server_name db.innshine.com;
bundle exec unicorn -E production -c ./config/unicorn.rb -D
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by [email protected] http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
def set_access_control_headers
response.headers['Access-Control-Allow-Origin'] = 'http://traderail.com'
response.headers['Access-Control-Request-Method'] = '*'
end

The talented individual will be in charge of building out the features of techlist.asia which was launched recently. This is an exciting opportunity for the individual as our websites are visited by over a million users monthly from around the world. Our goal is to make techlist.asia the bridge for investors and startups in Asia.

Responsibilities for Full Stacked Engineer

  • Work with Product Manager on new features of Techlist (Specs will be handled by Product Manager and CTO)
  • Ensure features are rolled out according to schedule
  • Kill any bugs on the website
  • Iterate fast and quick
  • Current stack is Heroku + ROR + jquery
@-webkit-keyframes bgcolor { 0% { background-color: #ffccf2; }
50% { background-color: #ccffcc; }
100% { background-color: #ccffff; } }
@-moz-keyframes bgcolor { 0% { background-color: #ffccf2; }
50% { background-color: #ccffcc; }
100% { background-color: #ccffff; } }
@-ms-keyframes bgcolor { 0% { background-color: #ffccf2; }
50% { background-color: #ccffcc; }

I sometimes work on static sites and this is how I do it.

Pow is the best way to work on a static site locally. showoff.io is the best way to view it on any device anywhere. And once you're ready to ship, heroku can host it for free with fairly good performance.

Also, I assume you are willing to use the Terminal or command line.

Terminal commands will look like

$ ls