Skip to content

Instantly share code, notes, and snippets.

View lytsing's full-sized avatar

Lytsing Huang lytsing

View GitHub Profile
@lytsing
lytsing / setup.md
Last active August 15, 2018 09:11 — forked from flyingoctopus/setup.md
Set up Textmate for Rails usage

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.

@lytsing
lytsing / centos-install-gitlab_ci
Last active August 29, 2015 14:09 — forked from hotmob/centos-install-gitlab_ci
CentOS 6.5 x64 Install Gitlab-CI 5.1
#!/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
@lytsing
lytsing / simulate_server.rb
Last active August 29, 2015 14:07
simulate http api(json) server.
#!/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'
@lytsing
lytsing / ShortenUrl.java
Created September 21, 2012 08:05
Make long url into short url from http://t.cn write with 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;
@lytsing
lytsing / sina-shorten-url.rb
Created September 21, 2012 07:52
Make long url into short url from http://t.cn
#!/usr/bin/ruby
#
# encoding: utf-8
#
# Make long url into short url from http://t.cn
#
require "uri"
require "net/http"
params = {