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
print 'Hello World' |
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 web = require('webjs'), | |
mongoose = require('mongoose'), | |
config = require('./config'), | |
EventProxy = require('EventProxy.js').EventProxy, | |
Schema = mongoose.Schema; | |
mongoose.connect('mongodb://' + config.db.host + ':' + config.db.port + '/weblog'); | |
var Comment = new Schema({ | |
author: String, | |
content: String, |
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
https = require('https'); | |
function API(host){ | |
this.get = function(path,method,callback){ | |
var options = { | |
host: host, | |
path: path, | |
method: method | |
}; |
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
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/javascript");</script> |
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
//It depends on Google Feed API | |
//Check <script type="text/javascript" src="https://www.google.com/jsapi"></script> is included in HTML | |
var ggrss = (function(){ | |
var cache = []; | |
return { | |
parse: function(url,num,callback){ | |
google.load("feeds","1"); | |
//I found that google.load() should not be called while your page is ready, or the page will be cleared |
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
//insert | |
storedb('players').insert({"name":"Randy","sex":"male","score":20},function(err,result){ | |
if(!err){ | |
//do sth... | |
} else //do sth... | |
}) | |
//find | |
storedb('players').find({"name":"Randy"},function(err,result){ | |
if(!err){ |
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
// ==UserScript== | |
// @name fxxksise | |
// @namespace http://djyde.github.io | |
// @version 0.1.1 | |
// @description fixed sise js mistake | |
// @author Randy | |
// @match http://class.sise.com.cn:7001/sise/* | |
// @grant none | |
// ==/UserScript== |
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
// rmdown URL to magnet | |
// Usage: | |
// $ node index.js http://www.rmdown.com/link.php?hash=151f9114f14a0053fdbb8310045fb90f71935e7901c | |
// magnet:?xt=urn:btih:1f9114f14a0053fdbb8310045fb90f71935e7901c | |
// had copy to clipboard! | |
// Randy 2015 | |
// djyde.github.io |
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
// ==UserScript== | |
// @name rm2mag1024 | |
// @namespace http://djyde.github.io/ | |
// @version 0.1.1 | |
// @description Automatically convert rmdown to magnet and show on the top of 1024 page | |
// @author Randy | |
// @match http://t66y.com/htm_data/* | |
// @grant none | |
// ==/UserScript== |
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
list.setOnScrollListener(new RecyclerView.OnScrollListener() { | |
@Override | |
public void onScrolled(RecyclerView recyclerView, int dx, int dy) { | |
visibleItemCount = layoutManager.getChildCount(); | |
totalItemCount = layoutManager.getItemCount(); | |
pastItems = layoutManager.findFirstVisibleItemPosition(); | |
if (!onLoading) { | |
if ((pastItems + visibleItemCount) >= totalItemCount) { |
OlderNewer