Install kafka
brew install kafka
The above will install kafka and it's dependency zookeeper
You can start in the background by
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
function getHeight(elementStyle) { | |
return parseInt(elementStyle.height) + parseInt(elementStyle["margin-top"]) + parseInt(elementStyle["margin-bottom"]); | |
} | |
function trimText(element, elementHeight, maxHeight) { | |
var tmpText = element.innerHTML; | |
var words = tmpText.split(" "); | |
var min = 0; | |
var max = words.length; |
# for redirecting hhtp traffic to https version of the site | |
server { | |
listen 80; | |
server_name example.com; | |
return 301 https://$server_name$request_uri; | |
} | |
# for redirecting to non-www version of the site | |
server { | |
listen 80; |
I hereby claim:
To claim this, I am signing this object:
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure
flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.
Use production SSL certificates locally. This is annoying
Hello::Application.routes.draw do |map| | |
match ':controller(/:action(/:id(.:format)))' | |
end |
head -4 REPO_NAME.dump > REPO_NAME-partial.dump && tail -n +$(grep -n "Revision-number: $(($(svn info file:///REPO_PATH/REPO_NAME | grep Revision | awk -F": " '{print $2}') + 1))" REPO_NAME.dump | awk -F":" '{print $1}') REPO_NAME.dump >> REPO_NAME-partial.dump && svnadmin load /REPO_PATH/REPO_NAME < REPO_NAME-partial.dump |
# in features/support/env.rb | |
require 'selenium/webdriver' | |
# we need a firefox extension to start intercepting javascript errors before the page | |
# scripts load | |
Capybara.register_driver :selenium do |app| | |
profile = Selenium::WebDriver::Firefox::Profile.new | |
# see https://github.com/mguillem/JSErrorCollector | |
profile.add_extension File.join(Rails.root, "features/support/extensions/JSErrorCollector.xpi") | |
Capybara::Selenium::Driver.new app, :profile => profile |
# Hack for Capybara to use SSL connections using selenium. | |
# | |
### Usage: | |
# Require this from rails_helper.rb | |
# | |
### Steps to generate a SSL certificate on a Linux box: | |
# 0. Starting from 'Rails.root' | |
# 1. Generate private key. Type in some password. | |
# $ openssl genrsa -des3 -out private.key 4096 | |
# 2. Generate certificate sign request |