Slides: https://speakerdeck.com/davydovanton/hanami-architecture
Telegram channel (russian): https://t.me/pepegramming
Ссылки на конкретные посты: http://telegra.ph/Pepegramming-Contents-07-16
Slides: https://speakerdeck.com/davydovanton/hanami-architecture
Telegram channel (russian): https://t.me/pepegramming
Ссылки на конкретные посты: http://telegra.ph/Pepegramming-Contents-07-16
| @MyComponent = | |
| props: ['myProp'] | |
| template: '<div>A custom component with {{myProp}}</div>' |
| // Use like: trace("Friendly name", pipe)(map(...), filter(...), etc(...)) | |
| export const trace = (name, comp) => (...fns) => comp(...fns.map((fn, i) => { | |
| return (...args) => { | |
| try { return fn(...args); } catch(e) { | |
| e.message = `Error in ${comp.name}() sequence ${name} at step ${i} (${fn.name || '<anon>'}()): ${e.message}`; | |
| throw e; | |
| } | |
| }; | |
| })); |
| #!/usr/bin/env bash | |
| # Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/ | |
| ### | |
| # Label definitions | |
| ### | |
| declare -A LABELS | |
| # Platform |
| # Copyright (c) 2013 Georgios Gousios | |
| # MIT-licensed | |
| create database stackoverflow DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; | |
| use stackoverflow; | |
| create table badges ( | |
| Id INT NOT NULL PRIMARY KEY, | |
| UserId INT, |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), 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(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| connection = Faraday::Connection.new('http://example.com') do |builder| | |
| builder.request :url_encoded # for POST/PUT params | |
| builder.adapter :net_http | |
| end | |
| # same as above, short form: | |
| connection = Faraday.new 'http://example.com' | |
| # GET | |
| connection.get '/posts' |
| # Rename tags named foo-bar-#.#.# to v#.#.# and push the tag changes | |
| git tag -l | while read t; do n="v${t##*-}"; git tag $n $t; git push --tags ; git tag -d $t; git push origin :refs/tags/$t ; done |