Ruby 2.1.3 and newer on Cloud Foundry with Heroku’s Buildpack

If you’re using the Heroku Buildpack on Cloud Foundry (or Anynines or …) and want to use a stable Ruby version >= 2.1.3, cf push will fail downloading ruby version >= 2.1.3 during staging.

You have to use the STACK environment variable for ruby version >= 2.1.3 and specify the value cedar for example.

Modify the Gemfile:

source 'https://rubygems.org'

ruby '2.1.4'
...

Set the STACK environment variable for your app:

$ cf set-env APP STACK cedar

Push your app and enjoy ruby version >= 2.1.3:

$ cf push APP -b https://github.com/heroku/heroku-buildpack-ruby

This change is required for ruby versions >= 2.1.3 because Heroku Buildpack added support for different stacks, see:
https://github.com/heroku/heroku-buildpack-ruby/blob/master/CHANGELOG.md#v121-6302014

 

UPDATE 2014-10-30: ruby 2.1.4 mentioned

 

ios8 today app extension

Today App Extension Experiments on iOS 8

I’ve played around with the Today App Extensions that has been introduced with iOS 8.

Sample Code

There’s a nice blog post/tutorial by Lammert Westerhoff creating a more advanced sample extension than the iOS template by Apple.

Simulator

Most of the time the simulator does not run the current code with Xcode 6.0.1. You have to manually reset the simulator and run the current extension again to see the newest results. Hope this gets fixed in the next release.

App Bundle

Unfortunately you have to create a real app next to the today extension. I can imagine that in most cases you want simple today extension settings dialogs where you can setup your extension and don’t want a big fat app to distribute.

Local PostgreSQL Setup

Shell configuration (~/.bashrc, ~/.zshrc, …)

export PGDATA=~/anywhere/postgresql_data # PostgreSQL data directory
export PGHOST="/tmp"
alias pgstart="pg_ctl start"
alias pgstop="pg_ctl stop"

Initial setup

$ initdb -A md5 -E UTF8 -U $USER -W

$ vim $PGDATA/postgresql.conf

listen_addresses = 'localhost'

$ vim $PGDATA/pg_hba.conf

# TYPE DATABASE USER ADDRESS METHOD
# ADD THE FOLLOWING LINE AND REPLACE 'YOUR_USER' by $USER
local all YOUR_USER trust

Start/Stop PostgreSQL

$ pgstop
$ pgstart

Important commands

$ createdb database_name # create new database
$ dropdb database_name # drop database
$ psql -p # list all available databases
$ psql database_name # connect to database

psql console

\? # help
\d # list tables (and other things)
\d table_name # show table schema

Kanbanery overview with banery_stats

I’ve created a very simple gem called banery_stats to view my #tasks for every project for my kanbanery account.

It’s very simple to use. First you have to manually get your kanbanery api token. Afterwards it’s as simple as:

$ export KANBANERY_API_TOKEN=my_token
$ banery_stats
WORKSPACE name0 #projects: 2
0 project1
3 project2
WORKSPACE name1 #projects: 3
3 project3
12 project4