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
'use strict'; | |
var crypto = require('crypto'); | |
var path = require('path'); | |
var Promise = require('bluebird'); | |
var Invalidation = function (config, s3EventRecord) { | |
this.record = s3EventRecord; | |
this.config = config; |
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
#http://github.com/hungryblank/aws_sdb_bare | |
# | |
#remember to install the gems!! | |
#sudo gem install hungryblank-aws_sdb_bare -s http://gems.github.com | |
#sudo gem install open-uri | |
# | |
#The first thing you probably want to do on SimpleDb is creating a domain. | |
#The domain is a container for SimpleDB records. | |
#let's require the gems we need |
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 'aws_sdb_bare' | |
require 'nokogiri' | |
require 'net/http' | |
require 'uuid' | |
include AwsSdb | |
include AwsSdb::Request | |
module HttpHandler |
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 'nokogiri' | |
class Page | |
attr_accessor :html | |
include EM::Deferrable | |
def initialize(url_as_a_hash) | |
client = EM::Protocols::HttpClient.request(url_as_a_hash) | |
@html = nil |
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
LIBDIR = `erl -eval 'io:format("~s~n", [code:lib_dir()])' -s init stop -noshell` | |
VERSION = 0.0.1 | |
CC = erlc | |
ERL = erl | |
EBIN = ebin | |
CFLAGS = -I include -pa $(EBIN) | |
COMPILE = $(CC) $(CFLAGS) -o $(EBIN) | |
EBIN_DIRS = $(wildcard deps/*/ebin) |
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
syntax on | |
"Rainer paste | |
set ffs=unix " only support unix (could also be dos,mac) | |
syntax on " syntax highlighting on | |
set ruler " Always show current positions along the bottom | |
set noerrorbells " don't make noise | |
set showmatch " show matching brackets | |
set mat=5 " how many tenths of a second to blink matching brackets for | |
set so=3 " Keep 3 lines (top/bottom) for scope |
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
#backup from google cache, still useful for svn repos with funny structure that git svn can't understand automatically | |
First, clone the SVN repo with: | |
git-svn clone svn+ssh://your-server/home/svn/project-name/trunk -r NNNN project-name.git | |
where NNNN is some relatively recent revision, unless you like waiting forever for git-svn to sync. Make sure that the revision number you pick is actually on trunk -- don't just choose an arbitrary number in the past. Don't bother trying to pull branches with the -b argument at this point -- if that worked, we wouldn't be doing this. | |
Then, cd into project-name.git and: |
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
# A ping pong ball, which pings and pongs properly | |
class Ball | |
SOUNDS = %w(ping pong) | |
def initialize | |
@hit_count = 0 | |
end | |
def hit |
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
code stats retrieved from the sadly now dismissed getcaliper.com | |
================================================================ | |
1 LOC /1.1 LOTC | |
Flay 1 duplication /204.9 LOC | |
flog method: 10.1 | |
Saikuro method 2.2 | |
Reek 1 smell/9.6 LOC | |
Roodi 1 issue/89 LOC |
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 'spec/rake/spectask' | |
require 'rake/gempackagetask' | |
#Spec::Rake::SpecTask.new | |
gem_spec = eval(IO.read(File.join(File.dirname(__FILE__), "aws-sdb.gemspec"))) | |
desc "Open an irb session preloaded with this library" | |
task :console do |
OlderNewer