I hereby claim:
- I am msassak on github.
- I am msassak (https://keybase.io/msassak) on keybase.
- I have a public key ASAjH89ED49tJq0n3SVB4nLP0y08oTs2wQC-JDEtM8UfsQo
To claim this, I am signing this object:
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(query_start, clock_timestamp()), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env escript | |
| -define(dbg(X), io:format("DEBUG: ~p~n", [X])). | |
| -record(args, {primitives = [], | |
| patha = [], | |
| pathz = [], | |
| unrecognized = [], | |
| verbose = false, | |
| help = false}). |
| (ns demo | |
| (:require [clojure.core.async :as a :refer [go | |
| go-loop | |
| chan | |
| >! | |
| <! | |
| close]])) | |
| (defn int-producer | |
| "Return a channel containing the integers from 0 to n. |
| (deftest test-with-spy | |
| (let [state (atom []) | |
| spy (fn [& args] (swap! state into (vec args)))] | |
| (with-redefs [foo.bar.ns/side-effecting-fn spy] | |
| (fn-that-calls-side-effecting-fn :foo 1 {:whatever "hi"})) | |
| (is (= [:foo 1 {:whatever "hi"}] @state)))) |
| acc_func(Xs) -> | |
| acc_func(Xs, []). | |
| acc_func([], Acc) -> | |
| lists:reverse(Acc); | |
| acc_func([X|Xs], Acc) -> | |
| acc_func(Xs, [X * 2|Acc]). | |
| (defn acc-func [xs] | |
| (loop [my-xs (seq xs) acc []] |
| This is a test |
| %% From "Why Functional Programming Matters" by John Hughes | |
| -module(tree). | |
| -include_lib("eunit/include/eunit.hrl"). | |
| -export([fold/4, | |
| map/2]). | |
| -type label() :: any(). | |
| -type tree() :: {label(), [tree()]}. |
| export PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[36m\]\w\[\033[00m\]$(__git_ps1 "(%s)") \$ ' |
| # This: | |
| respond_to do |format| | |
| format.html do | |
| # generate html | |
| end | |
| format.js do | |
| # generate javascript | |
| end | |
| end |