Skip to content

Instantly share code, notes, and snippets.

View guange2015's full-sized avatar

gg guange2015

  • usa
View GitHub Profile
@guange2015
guange2015 / Monaco for Powerline.otf
Created November 14, 2015 05:43 — forked from baopham/Monaco for Powerline.otf
Patched font Monaco for OSX Vim-Powerline
#!/bin/bash
# CentOS rbenv system wide installation script
# Forked from https://gist.github.com/1237417
# Installs rbenv system wide on CentOS 5/6, also allows single user installs.
# Install pre-requirements
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \
make bzip2 autoconf automake libtool bison iconv-devel git-core
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'
#!/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")
@guange2015
guange2015 / proxy.rb
Created October 22, 2012 09:21 — forked from druzn3k/proxy.rb
A quick HTTP proxy server in Ruby.
#!/usr/bin/env ruby
# A quick and dirty implementation of an HTTP proxy server in Ruby
# because I did not want to install anything.
#
# Copyright (C) 2009 Torsten Becker <[email protected]>
require 'socket'
require 'uri'
@guange2015
guange2015 / static_server.js
Created May 18, 2012 01:32 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@guange2015
guange2015 / Get iOS MAC address.m
Created May 16, 2012 03:40 — forked from Coeur/Get iOS MAC address.m
Get iOS MAC address #
/* Original source code courtesy John from iOSDeveloperTips.com */
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_dl.h>
- (NSString *)getMacAddress
{
int mgmtInfoBase[6];