I hereby claim:
- I am almightycouch on github.
- I am mflach (https://keybase.io/mflach) on keybase.
- I have a public key ASBABULfJCzh1RDXC4CDxU_X7vCduitjDW0Szu0ygpOr2Qo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import RethinkDB.Query | |
require Logger | |
{:ok, pid} = RethinkDB.Connection.start_link | |
for i <- 1..3 do | |
spawn_link fn -> | |
Logger.debug "#{i} started" | |
{:ok, feed} = table("users") |
defmodule Bucket do | |
@behaviour Access | |
defstruct pid: nil | |
def start_link(default \\ %{}) when is_map(default) do | |
case Agent.start_link(fn -> default end) do | |
{:ok, pid} ->%__MODULE__{pid: pid} | |
{:error, message} -> raise message | |
end |
from django.db import transaction | |
@transaction.atomic | |
def update_or_create(model, **kwargs): | |
""" | |
Looks up an object with the given kwargs, updating one if it exists, | |
otherwise creates a new one. | |
This implementation differs from Django `update_or_create()` function. |
CREATE FUNCTION notify_changes() RETURNS trigger AS $$ | |
DECLARE | |
BEGIN | |
IF TG_OP = 'INSERT' THEN | |
PERFORM pg_notify('insert', json_build_object('table', TG_TABLE_NAME, 'new_val', row_to_json(NEW))#>>'{}'); | |
RETURN NEW; | |
ELSIF TG_OP = 'UPDATE' THEN | |
PERFORM pg_notify('update', json_build_object('table', TG_TABLE_NAME, 'new_val', row_to_json(NEW), 'old_val', row_to_json(OLD))#>>'{}'); | |
RETURN NEW; | |
ELSIF TG_OP = 'DELETE' THEN |
#!/usr/bin/env bash | |
curl -L https://github.com/uikit/uikit/archive/master.tar.gz | tar xz | |
cp -r uikit-master/src/less/ uikit | |
cp -r uikit-master/themes/ uikit/themes | |
rm -rf uikit-master | |
sed -i '' -e 's/src\/less\///g' uikit/themes/*/uikit*.less |