Skip to content

Instantly share code, notes, and snippets.

View youxiachai's full-sized avatar

youxiachai youxiachai

View GitHub Profile
@forthxu
forthxu / test google ips
Last active August 29, 2015 14:02
google g-f-w pings
#!/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
@RuiAAPeres
RuiAAPeres / gist:11402456
Last active August 29, 2015 14:00
Sam Page's SparkRecording Implementation with Facebook's Pop
//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];
@chrisbanes
chrisbanes / FloatLabelLayout.java
Last active March 15, 2024 06:39
FloatLabelLayout
/*
* Copyright 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@wzpan
wzpan / hexo_compile.sh
Last active February 19, 2019 13:42
A script to help me generate hexo blog and publish it to gitcafe.
#!/bin/zsh
CUR_DIR=$PWD
HEXO=/Users/wzpan/Documents/workspace/repositories/hexo-blog
PUBLISH=/Users/wzpan/Documents/workspace/repositories/wzpan
CSS=$HEXO/themes/bootstrap/source/css
JS=$HEXO/themes/bootstrap/source/js
DIST=$HEXO/themes/bootstrap/source/dist
PUBLIC=$HEXO/public
--[[ config
root = "./"
listen = "127.0.0.1:8786"
redisaddr = "127.0.0.1:6379[1]"
dbfile = root .. "backup.db"
thread = 4
logger = nil
harbor = 1
@soulmachine
soulmachine / Mutual.scala
Last active September 15, 2017 12:52
使用 Spark 计算新浪微博的互相关注的关系。输入为一个文本文件,每行的格式为 userid1, userid2, userid3,...,useridN, 表示用户userid1关注了userid2, userid3,...,useridN。输出也是一个文本文件,每行格式为 userid1, userid2,表示这两个用户互相关注了。
package com.yanjiuyanjiu.weibo
import org.apache.spark.SparkContext._
import org.apache.spark.{SparkContext, Logging}
/**
* 查找互相关注的关系。
*
* 输入为一个文本文件,每行的格式为 userId1, userId2, userId3,..., userIdN,表示 userId1 关注了 userId2, userId3, ..., userIdN
@totherik
totherik / npmjs.ini
Last active August 29, 2015 13:56
npmjs.org registry install script
; 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
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 {
@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

[
{
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"