Skip to content

Instantly share code, notes, and snippets.

View youxiachai's full-sized avatar

youxiachai youxiachai

View GitHub Profile
@youxiachai
youxiachai / array.js
Created May 29, 2014 10:24
js 数组练习
var newArray = ['1','2','3','4'].map(function (item){
return item
}).reduce(function (x, y){
if(Array.isArray(x)){
return x.concat(y)
}else{
var arr = [];
arr.push(x)
return arr;
}
@youxiachai
youxiachai / maimeng.js
Created April 11, 2014 02:34
js 卖萌代码..
var Z = function () {
}
Z.prototype.s = function () {
console.log('hi s')
}
var S = function () {
@youxiachai
youxiachai / redmime-wiki-telp.textile
Created December 23, 2013 05:39
redmime wiki project

POST 设置个人信息接口

接口描述

需要cookie

> 稳定性: 1 (未来会有变动)

apply plugin: 'android'
tasks.withType(Compile) {
options.encoding = "UTF-8"
}
dependencies {
// compile fileTree(dir: 'libs', include: '*.jar')
compile files('libs/fastjson-1.1.34.android.jar')
compile files('libs/umeng_sdk.jar')
@youxiachai
youxiachai / js.js
Created September 21, 2013 17:41
//字符串原型扩展
//去除空格
String.prototype.trim = function(){
return this.replace(/(^\s*)|(\s*$)/g, "");
};
// 判断是否为空
String.prototype.isEmpty = function(){
var str = this;
str = str.replace(/\r\n/g,"");
/*
* Copyright (C) 2012-10-24 JIN BIN BIN (AstroBoy)
*/
package com.example.datatest;
import java.io.UnsupportedEncodingException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.MessageDigest;
import java.security.PrivateKey;
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
private int mLastFirstVisibleItem;
private boolean mIsScrollingUp;
ew OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
}
@Override
var jsdom = require("jsdom");
jsdom.env({
html: "http://www.oschina.net/translate/list?type=2",
scripts: ["http://code.jquery.com/jquery.js"],
done: function (errors, window) {
var $ = window.$;
//获取页数
// var lastPage = $('ul.pager li').slice(-2, -1).text();
// console.log("lastPage-->" + lastPage);
SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Calendar cal = Calendar.getInstance();
System.out.println(dateFormater.format(cal.getTime()));