This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; CouchDB Config | |
; Drop in PREFIX/local.d/npmjs.ini | |
[couch_httpd_auth] | |
public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev | |
users_db_public = true | |
[httpd] | |
secure_rewrites = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//The calculations are coming from [here](https://gist.github.com/d-ronnqvist/11266321) (thanks David!) | |
- (void)updateAnimations | |
{ | |
CGFloat duration = self.duration * (1.f - [[self.progressLayers firstObject] strokeEnd]); | |
CGFloat strokeEndFinal = 1.f; | |
for (CAShapeLayer *progressLayer in self.progressLayers) | |
{ | |
POPBasicAnimation *popEndAnimation = [POPBasicAnimation animation]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#-*- coding:utf8 -*- | |
''' | |
Created on 2014-06-02 | |
# QQ:263967133 | |
# pings运行一般运行一次就够了,自己选一个ip段 | |
# google ip地址段 | |
# 64.233.160.0 - 64.233.191.255 | |
# 66.102.0.0 - 66.102.15.255 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.$ = angular.element; | |
// jqLite `.parent([selector])` 支持 selector | |
angular.$.prototype.parent = function(sel) { | |
if(!sel) return angular.$(this[0].parentNode); | |
var list = [].slice.call(document.querySelectorAll(sel)) | |
, currentNode = this[0] | |
, ret; | |
while(currentNode.nodeName !== 'HTML') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
if [ -d "$(brew --prefix)/Cellar" ]; then | |
node=`find /usr/local/Cellar -name node | grep iojs/.*/bin/node` | |
if [ ! -z "$node" ]; then | |
$node $@ | |
else | |
echo "io.js not installed" | |
fi | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bypass-tun = 0.0.0.0/8, 1.0.0.0/9, 1.160.0.0/11, 1.192.0.0/11, 10.0.0.0/8, 14.0.0.0/11, 14.96.0.0/11, 14.128.0.0/11, 14.192.0.0/11, 27.0.0.0/10, 27.96.0.0/11, 27.128.0.0/9, 36.0.0.0/10, 36.96.0.0/11, 36.128.0.0/9, 39.0.0.0/11, 39.64.0.0/10, 39.128.0.0/10, 42.0.0.0/8, 43.224.0.0/11, 45.64.0.0/10, 47.64.0.0/10, 49.0.0.0/9, 49.128.0.0/11, 49.192.0.0/10, 54.192.0.0/11, 58.0.0.0/9, 58.128.0.0/11, 58.192.0.0/10, 59.32.0.0/11, 59.64.0.0/10, 59.128.0.0/9, 60.0.0.0/10, 60.160.0.0/11, 60.192.0.0/10, 61.0.0.0/10, 61.64.0.0/11, 61.128.0.0/10, 61.224.0.0/11, 100.64.0.0/10, 101.0.0.0/9, 101.128.0.0/11, 101.192.0.0/10, 103.0.0.0/10, 103.192.0.0/10, 106.0.0.0/9, 106.224.0.0/11, 110.0.0.0/7, 112.0.0.0/9, 112.128.0.0/11, 112.192.0.0/10, 113.0.0.0/9, 113.128.0.0/11, 113.192.0.0/10, 114.0.0.0/9, 114.128.0.0/11, 114.192.0.0/10, 115.0.0.0/8, 116.0.0.0/8, 117.0.0.0/9, 117.128.0.0/10, 118.0.0.0/11, 118.64.0.0/10, 118.128.0.0/9, 119.0.0.0/9, 119.128.0.0/10, 119.224.0.0/11, 120.0.0.0/10, 120.64.0.0/11, 120.128.0.0/11, 120.192.0.0/10, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.yanjiuyanjiu.weibo | |
import org.apache.spark.SparkContext._ | |
import org.apache.spark.{SparkContext, Logging} | |
/** | |
* 查找互相关注的关系。 | |
* | |
* 输入为一个文本文件,每行的格式为 userId1, userId2, userId3,..., userIdN,表示 userId1 关注了 userId2, userId3, ..., userIdN |
OlderNewer