- Trade-off: scale vs. functionality. MongoDB tries to have good functionality and good scalability.
- Auto-sharding to maintain equilibrium between shards
- Scalable datastore != scalable application: use of datastore may still be non-scalable (e.g. many queries across all shards)
- Get low latency by ensuring shard data is always in memory: datastore
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
/* Based on http://kevinburke.bitbucket.org/markdowncss/ */ | |
body{ | |
margin: 0 auto; | |
font-family: Georgia, Palatino, serif; | |
color: #444444; | |
line-height: 1; | |
max-width: 960px; | |
padding: 30px; | |
} |
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
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "Please supply a commit SHA to tag." | |
exit 1 | |
fi | |
git tag -af deployed $1 -m "Deployed to production." && git push origin tag deployed |
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
d652de5c2ad34f4eb0ac89709559309c$0291b4935aa804fdb72d9da9a96ed80c |
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
<cfsetting enablecfoutputonly="true"> | |
<cfset variables.test_cases = { | |
raw_numeric = 123, | |
raw_float = 123.456, | |
zero_numeric = 000, | |
prefixed_numeric = 000123, | |
prefixed_float = 000123.456, | |
string_numeric = "123", | |
string_float = "123.456", |
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
component { | |
public string function encode(required any data) { | |
var json = serializeJSON(arguments.data); | |
if (!find("00", json)) { return json; } | |
if (left(json, 2) == "00") { json = '"#json#"'; } // just a simple value | |
// value in a structure | |
if (find('":00', json)) { json = rereplace(json, '[^\\]":([0]+)', '":"\1"', "ALL"); } | |
// value in an array (beginning, end, middle) | |
if (find('[00', json)) { json = rereplace(json, '[^\\]?\[([0]+)', '["\1"', "ALL"); } | |
if (find('00]', json)) { json = rereplace(json, ',([0]+)\]', ',"\1"]', "ALL"); } |
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
cd /tmp | |
brew update | |
brew upgrade ruby-build | |
rbenv install 2.0.0-p0 | |
rbenv shell 2.0.0-p0 | |
curl -fsSL curl.haxx.se/ca/cacert.pem -o "$(ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE')" | |
gem install bundler --pre # Successfully installed bundler-1.3.0.pre.8 | |
gem install rails # Successfully installed rails-3.2.12 | |
rails new test-app | |
cd test-app |
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
# Run with: | |
# | |
# curl -fsSL https://gist.github.com/timblair/5919255/raw | bash | |
$( which brew >/dev/null ) || ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
brew update | |
$( which rbenv >/dev/null) || brew install rbenv --HEAD | |
$( which ruby-build > /dev/null ) || brew install ruby-build --HEAD | |
brew upgrade ruby-build |
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
class NumberConverter | |
UNITS = [nil] + %w{ one two three four five six seven eight nine ten eleven | |
twelve thirteen fourteen fifteen sixteen seventeen eightteen nineteen } | |
TENS = %w{ twenty thirty forty fifty sixty seventy eighty ninety } | |
SCALE = %w{ hundred thousand } + | |
%w{ m b tr quadr quint sext sept oct non dec }.map { |i| i + "illion" } | |
# cache some lookups for a ~25% speed increase | |
@@cache ||= {} |