Worked 2015-09-08 for Phoenix 1.0.1 on Dokku 0.3.25.
These instructions assume you've set up Dokku. If not, go find a tutorial for that part. My notes for setting it up on Digital Ocean.
Create a Dokku app:
Worked 2015-09-08 for Phoenix 1.0.1 on Dokku 0.3.25.
These instructions assume you've set up Dokku. If not, go find a tutorial for that part. My notes for setting it up on Digital Ocean.
Create a Dokku app:
| defmodule MyBlog.Repo.Migrations.CreatePost do | |
| use Ecto.Migration | |
| def change do | |
| create table(:posts, primary_key: false) do | |
| add :id, :uuid, primary_key: true | |
| add :body, :string | |
| add :word_count, :integer | |
| timestamps |
| # Full list of Russian Federation time zones with helper to get this list. | |
| # Place this file in config/initializers/timezones.ru.rb | |
| class ActiveSupport::TimeZone | |
| @country_zones = ThreadSafe::Cache.new | |
| def self.country_zones(country_code) | |
| code = country_code.to_s.upcase | |
| @country_zones[code] ||= | |
| TZInfo::Country.get(code).zone_identifiers.select do |tz_id| |
| # Basic Strongswan ikev2 server setup | |
| * paltform: atlantic.net ubuntu 14.04 x64 | |
| * the commands below are run with root account | |
| ## Strongswan | |
| ``` | |
| apt-get install strongswan | |
| apt-get install iptables iptables-persistent | |
| ``` |
Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.
For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.
But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.
SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil
| #! /bin/bash | |
| # directory to save backups in, must be rwx by postgres user | |
| BASE_DIR="/var/backups/postgres" | |
| YMD=$(date "+%Y-%m-%d") | |
| DIR="$BASE_DIR/$YMD" | |
| mkdir -p $DIR | |
| cd $DIR | |
| # make database backup |
| # Install Git needed for Git based gems | |
| packages: | |
| yum: | |
| git: [] | |
##Preview
Display your iOS App Rating info. It uses iTunes Store website as the source.
##Usage
| <? | |
| require("redis.php"); | |
| require("json.php"); | |
| $term = $_GET['term']; | |
| $r = new Redis("127.0.0.1","6379"); | |
| $r->connect(); | |
| $items = $r->zrangebylex("kernel","[$term","[$term\xff",Array("LIMIT","0","10")); |