View example.clj
(require 'kinsky.client)
(def p (kinsky.client/producer { :bootstrap.servers "localhost:9092" } (kinsky.client/keyword-serializer) (kinsky.client/json-serializer)))
(kinsky.client/send! p "my-topic" :what-is-a-keyword { :foo "bar" })
View info.md
View edit-form-config.json
// GET /forms/edit-person-study-assignment?pk=ABC123
// pk is a study reference
{
id: "edit-person-study-assignment",
table: "study_assignments",
url: "/forms/{{ id }}", // default
method: "POST", // default
foreign_key: "study_id" // SELECT * FROM {{ table }} WHERE {{ foreign_key }}={{ pk }} LIMIT 1
View main.yml
- name: Install mod_pagespeed
apt:
deb: https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
- name: Install Apache and related packages
apt: pkg={{ item }} state=installed
with_items:
- apache2
- name: Enable Apache modules
View .travis.yml
language: ruby
before_install:
- gem update --system
- gem update bundler
script: rspec spec
sudo: false
dist: trusty
rvm:
- rbx-3.69
View 1.md

commands

{
  id: "assign-person-to-study",
  url: "/commands/:id",
  method: "POST",
  fields: [
    { key: "study_id", type: "integer" },
    { key: "title", type: "string", select: true, collection: ["Dr", "Mr", "Mrs", "Miss"], validate: { presence: true, included: :collection } },
View snippets.clj
;; Extract values from hashmaps of hashmaps
;; { :anything { :the-key "a" :another-key "b" } :something { :the-key "aa" :another-key "bb" } ... }
;; we want all the `:the-key` values, i.e. `("a" "aa")`.
(map #(:the-key %) (vals my-collection))
(flatten list-of-list) ;; => list
(concat vector-of-vectors) ;; => list
View 01-command.md
$ ab -n 1000 -c 10 -l http://localhost:3000/nhs-trusts
  • Server Software: Jetty(7.6.13.v20130916)
  • Server Hostname: localhost
  • Server Port: 3000
  • Document Path: /nhs-trusts
  • Document Length: Variable
  • Concurrency Level: 10
View api.json
{"questions":[{"id":1,"question_html":"By Friday of this week, how many extra people will be living on our planet?","facts":"At the current rate of population growth there will be an extra 1,000,000 people on earth in the next 5 days. That's a lot! Can't picture 1 million people? Imagine 100 people, or enough people to fill a Boeing 737, arriving in your back garden... every day, for the next 30 years. All between now and Friday.\r\n\r\nFind out more about population growth here: http://www.worldometers.info/world-population/","answers":[{"answer_html":"xxddd","fake":false},{"answer_html":"sfsf","fake":true}]},{"id":2,"question_html":"hello","facts":"asdasdasd","answers":[{"answer_html":"False","fake":false},{"answer_html":"True","fake":false}]},{"id":3,"question_html":"asdfasd","facts":"asdasdasd","answers":[{"answer_html":"True","fake":true},{"answer_html":"False","fake":false}]}]}
View a better solution.md

Instead of inheritence we can use a mixin, since this is Rails a concern will do nicely.

module Other
  module RailsConfig
    extend ActiveSupport::Concern

    included do
      config...
    end