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
RATE_LIMIT_SCRIPT = r''' | |
local now = tonumber(ARGV[1]) | |
local required = tonumber(ARGV[2]) | |
local rate = tonumber(ARGV[3]) | |
local per_secs = tonumber(ARGV[4]) | |
local do_subtract = tonumber(ARGV[5]) == 1 | |
local full_at = tonumber(redis.call('GET', KEYS[1])) or 0 | |
local score, result | |
if full_at < now then | |
score = rate |
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
import re | |
from jinja2 import Markup | |
from SOMEOTHERLIBRARYFOROTHERSTUFF import format_user_input | |
def strip_auth_tokens(value): | |
from classlet.models import auth_token_re | |
return auth_token_re.sub(u'', value) | |
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
# Requires Java! OH NO! | |
require 'java' | |
require 'disruptor' # you'll need to snag disruptor.jar | |
module Warbird | |
class Worker | |
include com.lmax.disruptor.WorkHandler | |
java_import 'java.nio.ByteBuffer' | |
def initialize(ring_buffer) |
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
Debugger attached successfully. | |
Server compiler detected. | |
JVM version is 20.0-b12 | |
Deadlock Detection: | |
No deadlocks found. | |
Thread 10819: (state = BLOCKED) | |
- java.lang.Thread.sleep(long) @bci=0 (Interpreted frame) | |
- com.amazonaws.http.IdleConnectionReaper.run() @bci=3, line=75 (Interpreted frame) |
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
Appirater | |
AQGridView | |
AutoHyperlinks | |
Boost | |
Chromium | |
CocoaLumberjack | |
CoreTextHyperlinkView | |
EGODatabase | |
EGOTableViewPullRefresh | |
HPGrowingTextView |
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
# ========================== | |
# Getting Started with klogd | |
# ========================== | |
# | |
# Klogd is a dumb script to stream Syslog messages to a Kafka server. | |
# | |
# 1) Make sure you have all dependencies installed properly | |
# | |
# - Twisted | |
# - PyParsing |
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
[program:keepalived-check] | |
command=/usr/sbin/keepalived | |
--use-file /etc/keepalived/keepalived.conf | |
--dont-fork | |
--dump-conf | |
--log-detail | |
--log-facility 0 | |
--check | |
--pid /var/run/keepalived_check.pid | |
redirect_stderr=true |
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 'railsless-deploy' | |
# Your application name | |
set :application, "someapp" | |
# We're not deploying from a repo, since this is scala and we | |
# need to compile. Set SCM to none | |
set :scm, :none | |
# Our deploy is to copy the contents of… |
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
# this can be done anytime | |
heroku addons:add heroku-postgresql:standard-yanari --app nav-chronos; heroku pg:wait | |
# about 3m30s | |
heroku maintenance:on | |
heroku ps:scale worker=0 | |
heroku pgbackups:capture --expire | |
# less than 20 min |
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
// Scraping Made Easy with jQuery and SelectorGadget | |
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga) | |
// by David Trejo | |
// | |
// Install node.js and npm: | |
// http://joyeur.com/2010/12/10/installing-node-and-npm/ | |
// Then run | |
// npm install jsdom jquery http-agent | |
// node numresults.js | |
// |
OlderNewer