ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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 | |
# Trap sigterm and sleep before passing signal to child for $SIGNAL_TIMEOUT seconds | |
# this is to address a shutdown issue with traefik: https://docs.traefik.io/user-guide/marathon/#shutdown | |
cmd=${*} | |
# default to 10 seconds | |
SIGNAL_TIMEOUT=${SIGNAL_TIMEOUT:-10} | |
log() { |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
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
# Add this script in your SublimeText Packages/User directory | |
import sublime, sublime_plugin | |
class DefaultSyntaxCommand(sublime_plugin.EventListener): | |
def on_new(self, view): | |
view.set_syntax_file('Packages/Markdown/Markdown.tmLanguage') |
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 MyWorker | |
include Sidekiq::Worker | |
sidekiq_options unique_for: 10.minutes | |
def perform(...) | |
end | |
end |
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
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
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 'rails_helper' | |
RSpec.describe 'My API' do | |
let(:request) do | |
lambda do | |
get '/my_api/value-cannot-be-routed-due-to-route-constraints' | |
end | |
end | |
context 'when action_dispatch.show_exceptions is false (default behavior on test env)' 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
Rails.application.configure do | |
# Settings specified here will take precedence over those in config/application.rb. | |
... | |
# Raise exceptions instead of rendering exception templates. | |
config.action_dispatch.show_exceptions = true | |
... | |
end |
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
v1 = '0.3.0' | |
v2 = '0.3' | |
a1 = v1.split('.').map{|v| v.to_i} | |
a2 = v2.split('.').map{|v| v.to_i} | |
(a1 <=> a2) == 0 # v1 == v2 | |
=> false | |
(a1 <=> a2) > 0 # v1 > v2 | |
=> true |