The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
namespace :grape do | |
desc 'Print compiled grape routes' | |
task :routes => :environment do | |
API.routes.each do |route| | |
puts route | |
end | |
end | |
end |
#!/bin/bash -e | |
# Lifted from: https://github.com/adrienthebo/git-tools/blob/master/git-truncate | |
# Note: seem to be finding the need to run this twice over to commit the truncate | |
if [[ (-z $1) || (-z $2) ]]; then | |
echo "Usage: $(basename $0) <drop before SHA1 commit> <branch>" | |
exit 1 | |
fi | |
git filter-branch --parent-filter "sed -e 's/-p $1[0-9a-f]*//'" \ |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
git ls-files | egrep '\.erl|\.ex[s]$' | xargs cat | sed '/^$/d' | wc -l |
This runs a build for a small elixir (phoenix) project in about 40 seconds by caching as much of the compiled files as possible.
We've been using this for months in multiple projects without any issues. Please ping be if there is any issues with this script and I'll update it.
It should be generic enough to work on any elixir app using mix.
If you have a elixir_buildpack.config
, then enable that section in the build script to keep versions in sync!
I've taken the benchmarks from Matthew Rothenberg's phoenix-showdown, updated Phoenix to 0.13.1 and ran the tests on the most powerful machines available at Rackspace.
Framework | Throughput (req/s) | Latency (ms) | Consistency (σ ms) |
---|
defmodule MyApp do | |
use Application | |
def start(_type, _args) do | |
import Supervisor.Spec, warn: false | |
children = [ | |
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [ | |
dispatch: dispatch | |
]) |