近来由于 Mac 出了点小问题一直没有解决,加上用了已经有好长一段时间,一直想清理一下(精神洁癖作祟),所幸重装了事。没有使用 TimeMachine,所以需要先行将一些觉得尚有价值的文件拷贝下来。
写下这篇文章,也是为了以后再次遇到问题能够有章可循,不至于胡乱一通重装。本文也会持续更新,欢迎大家分享更好的使用技巧与经验。
在线恢复系统实在太慢,进行在 Windows 下制作 Mac U盘启动盘重装系统. 额外所需的物理设备为 U 盘一个,8G 及以上为宜。
#!/usr/bin/env node | |
/* jshint node: true */ | |
'use strict'; | |
var program = require('commander'); | |
function add(a, b){ | |
return a + b; | |
} | |
function numericSort(a,b) { |
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
require 'amqp' | |
module HiringThingEM | |
def self.start | |
if defined?(PhusionPassenger) | |
PhusionPassenger.on_event(:starting_worker_process) do |forked| | |
# for passenger, we need to avoid orphaned threads | |
if forked && EM.reactor_running? | |
EM.stop | |
end | |
Thread.new { |
project :test => :shoulda, :renderer => :haml, :stylesheet => :sass, :script => :jquery, :orm => :activerecord | |
#default routes | |
APP_INIT = <<-APP | |
get "/" do | |
"Hello World!" | |
end | |
get :about, :map => '/about_us' do | |
render :haml, "%p This is a sample blog created to demonstrate the power of Padrino!" |
project :test => :shoulda, :renderer => :haml, :stylesheet => :sass, :script => :jquery, :orm => :activerecord | |
#default routes | |
APP_INIT = <<-APP | |
get "/" do | |
"Hello World!" | |
end | |
get :about, :map => '/about_us' do | |
render :haml, "%p This is a sample blog created to demonstrate the power of Padrino!" |
# Usage: | |
# [sudo] gem install mechanize | |
# ruby tumblr-photo-ripper.rb | |
require 'rubygems' | |
require 'mechanize' | |
# Your Tumblr subdomain, e.g. "jamiew" for "jamiew.tumblr.com" | |
site = "doctorwho" |
# coding=utf-8 | |
import Image, ImageDraw, ImageFont | |
import struct | |
font_width = 16 | |
font = ImageFont.truetype("/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc", font_width) | |
def get_font_data(char): |