正しい実装でt.coの見えない世界へ
document: https://dev.twitter.com/docs/streaming-api/user-streams
正しい実装でt.coの見えない世界へ
document: https://dev.twitter.com/docs/streaming-api/user-streams
#!/usr/bin/env ruby | |
# | |
# a capistrano strategy to deploy sub-directory in the repository. | |
# this is a stuff like "remote_cache_subdir" strategy described in following page, | |
# but based on "copy" strategy of capistrano deploy recipe. | |
# | |
# http://stackoverflow.com/questions/29168/deploying-a-git-subdirectory-in-capistrano | |
# | |
require 'capistrano' |
原題:Dynamo: Amazon’s Highly Available Key-value Store
原文: Amazon's Dynamo - All Things Distributed (PDF Version)
This article is translated by @ono_matope. Please contact me if any problem.
Ruby の HTTP クライアントライブラリ Faraday が便利そう
API ラッパの開発には [RestClient gem][rest_client_gem] だとか
OAuth の必要なものは [Net/HTTP][net_http] + [OAuth gem][oauth_gem] を使ってた
[Twitter gem][twitter_gem] や [Instagram gem][instagram_gem] など API ライブラリのソースを読んでみると
[Faraday gem][faraday_gem] というものがよく使われてた
var amqp = require('amqp'); | |
var util = require('util'); | |
/* | |
* 指定したルーティングキーで定期的にデータを送信する | |
* Usage: node pub.js key1 key2 key3 | |
*/ | |
function main(argv) { |
<?php | |
require_once("aws.phar"); | |
use Aws\Common\Aws; | |
use Aws\Common\Enum\Region; | |
use Aws\S3\Enum\CannedAcl; | |
use Aws\S3\Exception\S3Exception; | |
use Guzzle\Http\EntityBody; | |
$access_key = 'Your Access Key'; |
成功した時はSuccessにラップして返し、例外時はFailureでラップして返す。いずれもscala.util.Tryのサブ型である。
scala> import scala.util._
import scala.util._
scala> case class ZeroLengthException(name:String) extends Exception(s"$name is zeo length")
defined class ZeroLengthException
scala> case class PrefixInvalidException(name: String) extends Exception(s"$name's prefix is invalid")
<?php | |
function set() { | |
return new Set(func_get_args()); | |
} | |
class Set implements Countable, Iterator { | |
private $data = array(); | |
function __construct($data) { |
require 'benchmark_helper' | |
# Describe performance like RSpec-ish DSL | |
describe Api::Notifications do | |
before do | |
# Can use FactoryGirl to populate data | |
@me = create :user | |
create :post, author: @user | |
1000.times do |