Skip to content

Instantly share code, notes, and snippets.

View fireyang's full-sized avatar

FireYang fireyang

View GitHub Profile
@fireyang
fireyang / gist_tag.rb
Created August 17, 2012 05:49 — forked from BinaryMuse/gist_tag.rb
A Liquid tag for Jekyll sites that allows embedding Gists and showing code for non-JavaScript enabled browsers and readers.
require 'cgi'
require 'digest/md5'
require 'net/https'
require 'uri'
module Jekyll
class GistTag < Liquid::Tag
def initialize(tag_name, text, token)
super
@text = text
@fireyang
fireyang / ios5webdebug.sh
Created October 25, 2012 00:39 — forked from ckotak/ios5webdebug.sh
Runs iOS 5 simulator with MobileSafari remote debug
#!/bin/bash
# Open iPhone Simulator on default location for XCode 4.3
open /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app
# Open mobile safari
echo Open mobile safari on emulator and press return
read
# Plug debug to MobileSafari.app
/*
This code takes a 2D transformation matrix described as a one-dimensional array
(in column order, top to bottom and left to right) and decomposes it using the dojo
matrix library. This input matrix should produce a 45-deg X skew:
1 1 0
0 1 0
0 0 1
The output of decompose() looks like this:
####################################################
###欢迎您选用 WWW.HOST700.com VPS 低价 稳定 实惠 ###
####################################################
#开始先配置shadowsocks这个就大概说下
git clone git://github.com/clowwindy/shadowsocks.git
#然后进入
cd shadowsocks
#然后配置下config.json文件
vim config.json #具体的配置自己看很简单
#运行服务端
//Workaround for Unity game slowing in iPhone4 + 7.1
//Write in main.mm
#include <pthread.h>
#include <dlfcn.h>
typedef int (*pthread_create_f)(pthread_t * __restrict, const pthread_attr_t * __restrict, void *(*)(void *), void * __restrict);
static pthread_create_f real_create = NULL;
extern "C" int pthread_create(pthread_t * __restrict thread, const pthread_attr_t * __restrict attr, void *(*start)(void *), void * __restrict arg)
@fireyang
fireyang / D.cs
Last active August 29, 2015 14:08 — forked from onevcat/D.cs
#define DEBUG_LEVEL_LOG
#define DEBUG_LEVEL_WARN
#define DEBUG_LEVEL_ERROR
using UnityEngine;
using System.Collections;
// setting the conditional to the platform of choice will only compile the method for that platform
apt-get install devscripts build-essential
apt-get build-dep golang-go
wget http://ftp.us.debian.org/debian/pool/main/g/golang/golang_1.3.1-1.dsc
wget http://ftp.us.debian.org/debian/pool/main/g/golang/golang_1.3.1.orig.tar.gz
wget http://ftp.us.debian.org/debian/pool/main/g/golang/golang_1.3.1-1.debian.tar.xz
dpkg-source -x golang_1.3.1-1.dsc
cd golang-1.3.1/
debuild -us -uc
[Names]
count=1
name0=Solarized Dark
[Solarized Dark]
text(bold)=839496
magenta(bold)=6c71c4
text=00ff40
white(bold)=fdf6e3
green=859900
red(bold)=cb4b16
@fireyang
fireyang / auth.go
Last active August 29, 2015 14:25 — forked from landaire/auth.go
package controllers
import (
"encoding/base64"
"errors"
"github.com/robfig/revel"
"net/http"
"strings"
)
@fireyang
fireyang / install.sh
Created November 25, 2015 04:01 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"