Skip to content

Instantly share code, notes, and snippets.

View guange2015's full-sized avatar

gg guange2015

  • usa
View GitHub Profile
@guange2015
guange2015 / gist:2758432
Created May 20, 2012 15:07
bootstrap common template.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
@guange2015
guange2015 / gist:2758331
Created May 20, 2012 14:39
Gemfile 3.2.3
source 'http://ruby.taobao.org'
gem 'rails', '3.2.3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3', '1.3.5'
@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];
- (void)viewDidLoad
{
[super viewDidLoad];
[webView setBackgroundColor:[UIColor clearColor]];
[self hideGradientBackground:webView];
[webView loadHTMLString:@"This is a completely transparent UIWebView. Notice the missing gradient at the top and bottom as you scroll up and down." baseURL:nil];
}
@guange2015
guange2015 / gist:2258904
Created March 31, 2012 03:11
instance_exec vs class_exec
# encoding: utf-8
# different instance_exec whit class_exec
class O
def self.haha
puts 'haha'
end
end
O.instance_exec {
@guange2015
guange2015 / gist:867937
Created March 13, 2011 06:54
vmware fusion
YU2NJ-JVGKY-44N8R-H8Q5Y-0PGE3 3YT81-KJMJR-04WHY-KMU72-KLNEE