Rails 5 recompiles templates on every request in test env. Fix will be released only in 5.0.2.
Add this lines to test helper to get the performance now (I've got x2 improvement):
class << ActionView::LookupContext::DetailsKey
def clear
# Nginx can serve FLV/MP4 files by pseudo-streaming way without any specific media-server software. | |
# To do the custom build we use 2 modules: --with-http_secure_link_module --with-http_flv_module | |
# This module "secure-link" helps you to protect links from stealing away. | |
# | |
# NOTE: see more details at coderwall: http://coderwall.com/p/3hksyg | |
cd /usr/src | |
wget http://nginx.org/download/nginx-1.5.13.tar.gz | |
tar xzvf ./nginx-1.5.13.tar.gz && rm -f ./nginx-1.5.13.tar.gz |
# ParseDate | |
# | |
# A helper for parsing dates of an unknown format. | |
# | |
# Takes a randomly formatted date and makes a best guess at the date, or throws and exception if | |
# there's no best guess. Will take international dates into account if you pass in a 'short form' date | |
# to help suggest a starting point for the search. | |
# Will also try Chronic parsing to get relative dates (yesterday, tomorrow, in 3 days, etc.) | |
# | |
# Examples: |
// @flow | |
import type { | |
StyleObj, | |
} from 'react-native/Libraries/StyleSheet/StyleSheetTypes'; | |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import { Text, View, StyleSheet } from 'react-native'; | |
import invariant from 'invariant'; |
import rx.Observable; | |
import rx.subjects.PublishSubject; | |
import rx.subjects.SerializedSubject; | |
import rx.subjects.Subject; | |
/** | |
* Simple pass-thru event bus with error handling and reconnect. | |
*/ | |
public class EventBus { |
# Outputs this at warn log level: | |
# 1.2.3.4 GET /path 200 OK BlahController#action HTML 938.2 (DB 11.8, View 719.7) {params} {optional params from flash[:log]} | |
# | |
# Save as config/initializers/oneline_detailed_logging.rb. Consider | |
# decreasing the log level from "info" to "warn" (in production.rb) so | |
# the one-line log message replaces the standard request logs. | |
# override process_action to add 2 things to the payload: | |
# - remote IP |
files: | |
"/opt/elasticbeanstalk/support/conf/sidekiq.conf": | |
mode: "000755" | |
content: | | |
description "Elastic Beanstalk Sidekiq Upstart Manager" | |
start on runlevel [2345] | |
stop on runlevel [06] | |
# explained above | |
respawn | |
respawn limit 2 30 |
A quick "how to" on what you need to do to both setup AND recover a single-server PostgreSQL database using WAL-E
GetObject
, ListBucket
and PutObject
on the bucket you want to use (and that it's not public).#!/usr/bin/env bash | |
if [ $# -eq 0 ]; then | |
echo "please supply a servername: bootstrap-server.sh node.example.com" | |
exit 1 | |
fi | |
username=`whoami` | |
# copy public rsa key to server for root user | |
read -r -p "Transfer ssh public keys to server for root? [y/N] " response | |
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then |
source :rubygems | |
# We are not loading Active Record, nor Active Resources etc. | |
# We can do this in any app by simply replacing the rails gem | |
# by the parts we want to use. | |
gem "actionpack", "~> 4.0" | |
gem "railties", "~> 4.0" | |
gem "tzinfo" | |
# Let's use thin |