This file contains hidden or 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
gemcutter => redis downloads spec | |
================================= | |
keys | |
---- | |
downloads => global counter for all gem downloads | |
downloads:today => sorted set for downloads from today | |
downloads:rubygem:rails => counter for all rails downloads | |
downloads:version:rails-2.3.5 => counter for all rails 2.3.5 downloads |
This file contains hidden or 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
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby | |
# - a browser with WebSocket support | |
# | |
# Usage: | |
# ruby redis_pubsub_demo.rb | |
# |
This file contains hidden or 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
# | |
# textapp -- Combined SMS and IM dispatching | |
# Copyright 2009 Max Battcher. All Rights Reserved. | |
# | |
# Microsoft Public License (Ms-PL) | |
# | |
# This license governs use of the accompanying software. If you use the | |
# software, you accept this license. If you do not accept the license, | |
# do not use the software. | |
# |
This file contains hidden or 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 ruby | |
require "rubygems" | |
require "mutter" | |
require "httparty" | |
REMOTE = "origin" | |
REPO = `git config --get remote.#{REMOTE}.url`.chomp[/github\.com[\/\:](\w+\/\w+)\.git/, 1] | |
USER = `git config --get github.user`.chomp | |
TOKEN = `git config --get github.token`.chomp |
This file contains hidden or 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
application: filehangar | |
version: live | |
runtime: python | |
api_version: 1 | |
handlers: | |
- url: /remote_api | |
script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py | |
login: admin |
This file contains hidden or 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
def hello(): | |
print "hello" | |
def hello2(): | |
print "hello2" | |
hello() | |
hello2() |
This file contains hidden or 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
class Dragon; end | |
# 使用 def 定義 class method | |
Dragon.instance_eval do | |
def foo | |
puts "bar" | |
end | |
end | |
Dragon.foo # bar |
This file contains hidden or 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
1: there is some hard code in the project like: | |
<% if false %> | |
Provided by <a href="http://recaptcha.net/" target="_blank">Recaptcha</a> | |
<% end %> | |
since the code wrap in the condition will never be execute, why not remove it . | |
2: maybe we can add fields into users for methods like "pending_count", so every time we load the information of user we don't need to join the friendships table. | |
3: we can move some big mail deliveries using background job (delayed_job etc.) , like InvitationMailer.deliver_invitations(@user, emails), since it will send couples of email out, it will lower the user experience to wait. |
This file contains hidden or 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 python | |
# | |
# Copyright 2007 Google Inc. | |
# | |
# 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 | |
# |
This file contains hidden or 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title>Demo Everywhere</title> | |
</head> | |
<body> | |
<h1>hello world</h1> | |
<ul> | |
{% for msg in messages%} |