Instantly share code, notes, and snippets.

View setup.md

Setup Textmate for Rails Dev on OS X

File/Folder Patterns

Wouldn't it be nice to be able to see hidden files and folders when working on a project in Textmate? As it turns out, it's built right in! Modify a few regex details with the tips below.

View centos-install-gitlab_ci
#!/bin/sh
rpm -Uih https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# Install vim and set as default editor
yum -y install vim-enhanced
update-alternatives --set editor /usr/bin/vim.basic
ln -s /usr/bin/vim /usr/bin/editor
View simulate_server.rb
#!/usr/bin/env ruby
#
# encoding: UTF-8
# File: simulate_server.rb
# This file use to simulate http api(json) server.
# Writen by Lytsing Huang 2013-11-19
# $Id$
#
require 'rubygems'
View ShortenUrl.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Map;
import java.util.LinkedHashMap;
import java.util.ArrayList;
View sina-shorten-url.rb
#!/usr/bin/ruby
#
# encoding: utf-8
#
# Make long url into short url from http://t.cn
#
require "uri"
require "net/http"
params = {