Skip to content

Instantly share code, notes, and snippets.

View youxiachai's full-sized avatar

youxiachai youxiachai

View GitHub Profile
@LiuJi-Jim
LiuJi-Jim / Matrix67.2011-2012.Maze.js
Created November 8, 2012 10:11
Matrix67 2011->2012 Maze
// v2.0,避免一个for (in),速度大幅度提高,但graph的构造不如之前优雅,优化了hash,总代码量几乎没有增加,加了点注释。
var ops = ['+7', '/2', '*3', '-5'];
var graph = [
[{e:0,n:1}, {e:1,n:1}],
[{e:0,n:0}, {e:1,n:0}, {e:2,n:2}, {e:3,n:2}],
[{e:2,n:1}, {e:3,n:1}]
]; // 第一维是顶点,第二维是出边,e是边的id,n是指向的顶点。
graph.forEach(function(vex, i){
vex.forEach(function(edge, j){
edge.f = new Function('val', 'return val' + ops[edge.e]); // 把边构造成一个function
@khernyo
khernyo / build.gradle
Created December 6, 2012 18:39
Gradle Android configuration with .so hack
// This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification
apply plugin: 'android'
targetCompatibility = 1.6
sourceCompatibility = 1.6
android {
target = 'android-14'
@yefuchs
yefuchs / gfw_contributors.md
Last active March 4, 2024 05:24
GFW Contributers

#The Great Firewall (GFW) Contributors List

注:数据来源为 dblp 和 cndblp, 下面括号中的数字表示 dblp 中显示的跟方滨兴合作论文的数量

###Binxing Fang (方滨兴)

中国工程院院士,北京邮电大学教授,中国科学院计算技术研究所网络方向首席科学家
http://en.wikipedia.org/wiki/Fang_Binxing

@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@jrhames
jrhames / moment-holidays.js
Last active January 19, 2023 03:12
Holidays plugin for Moment.JS
//## Moment.JS Holiday Plugin
//
//Usage:
// Call .holiday() from any moment object. If date is a US Federal Holiday, name of the holiday will be returned.
// Otherwise, return nothing.
//
// Example:
// `moment('12/25/2013').holiday()` will return "Christmas Day"
//
//Holidays:
@kimukou
kimukou / build.gradle
Last active December 17, 2015 09:39
android gradle plugin test
defaultTasks 'clean', 'build'
version = "x.y.z"
buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
@pboos
pboos / annotation-processor-build.gradle
Last active August 7, 2020 06:38
Gradle stuff for Android
configurations {
apt
}
dependencies {
compile 'com.squareup.dagger:dagger:1.1.0'
apt 'com.squareup.dagger:dagger-compiler:1.1.0'
}
android.applicationVariants.all { variant ->
[
{
name:"HTML5",
uri:"http://www.w3.org/TR/html5/single-page.html",
category:"markup"
},
{
name:"HTML 5.1",
uri:"http://www.w3.org/TR/html51/single-page.html",
category:"markup"
@LinusU
LinusU / README.md
Last active July 17, 2021 08:06 — forked from apla/icons_and_splash.js
Icons and Splash images for your Cordova project. (with iOS 7 support)

Usage

Install cordova into node_modules

npm install cordova

Add icons_and_splash.js

var requestLib = require("request"),
request = requestLib.defaults({
json:true
}, function(uri, options, callback){
var params = requestLib.initParams(uri, options, callback);
return requestLib(params.uri, params.options, function(err, res, body){
// treat bad status codes as errors
if (!err && res.statusCode >= 400) {
params.callback.apply(this, [res.statusCode, res, body]);
} else {