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
require 'rubygems' | |
require 'redis' | |
def main(opts={}) | |
r = Redis.new(opts) | |
um = 0 | |
while true do | |
newum = r.info[:used_memory] | |
if newum != um && um != 0 | |
diff = newum.to_i-um.to_i |
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/ruby | |
#author newdongyuwei@gmail.com | |
require 'uri' | |
require 'net/http' | |
require 'net/https' | |
require 'rexml/document' | |
#https://user:password@mail.google.com/mail/feed/atom | |
gmail_feed_url = "https://mail.google.com/mail/feed/atom" |
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
t = {} | |
meta = {__index = | |
function(_, idx) | |
return function(...) | |
-- ... will be table type "arg" | |
print(idx, arg[1]) | |
end | |
end} | |
setmetatable(t, meta) |
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
*.json | |
*.xml | |
token* | |
oauth* |
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 U = require("uglify-js"); | |
var fs = require("fs"); | |
var sys = require("sys"); | |
var code = fs.readFileSync("/tmp/test.js", "utf8"); | |
// 1. parse | |
var ast = U.parser.parse(code); | |
// 2. UglifyJS compress |
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
set :application, "yyyyyyyyyyy" | |
set :repository, "here-be-your-githubs" | |
set :scm, :git | |
set :branch, "master" | |
set :user, "xxxxxxxx" | |
set :scm_verbose, true | |
default_run_options[:pty] = true | |
set :deploy_via, :remote_cache | |
ssh_options[:forward_agent] = true |
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
require 'rubygems' | |
require 'eventmachine' | |
children = [] | |
Signal.trap('SIGINT') do | |
EventMachine.next_tick { EventMachine.stop_event_loop } | |
end | |
Signal.trap('EXIT') do |
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
# Configs | |
config defaultToCurrentScreen true | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize | |
config secondsBetweenRepeat 0.1 | |
config checkDefaultsOnLoad true | |
config focusCheckWidthMax 3000 | |
config keyboardLayout qwerty | |
config windowHintsShowIcons true | |
config windowHintsIgnoreHiddenWindows 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
var Routes = (function() { | |
var _ = {}, ctor = function(){}; | |
_.bind = function bind(func, context) { | |
var bound, args, slice = Array.prototype.slice; | |
args = slice.call(arguments, 2); | |
return bound = function() { | |
if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); | |
ctor.prototype = func.prototype; | |
var self = new ctor; | |
var result = func.apply(self, args.concat(slice.call(arguments))); |
OlderNewer