I hereby claim:
- I am voles on github.
- I am voles (https://keybase.io/voles) on keybase.
- I have a public key ASAOjePk0T8yqrP3FMKPX0gakD5aAM6ySU5I1IMPGrMqRQo
To claim this, I am signing this object:
#!/usr/bin/env bash | |
bp () { | |
git fetch | |
latestTag=$(git tag | tail -n1) | |
versionParts=($(echo "$latestTag" | tr '.' '\n')) | |
newTag="${versionParts[1]}.${versionParts[2]}.$(($versionParts[3] + 1))" | |
echo "new patch version is: $newTag" |
package code_kata | |
import "testing" | |
import "strconv" | |
//func TestLineCount(t *testing.T) { | |
// buffer := fizbuzz() | |
// | |
// if len(buffer) != 100 { | |
// t.Fail("expected 100 lines") |
I hereby claim:
To claim this, I am signing this object:
// Directory maps every file from a directory into an API model | |
func Directory(directory string) ([]models.API, error) { | |
files, err := ioutil.ReadDir(directory) | |
workerQueue := make(chan string) | |
APImodelsChan := make(chan result) | |
output := []models.API{} | |
if err != nil { |
function fetchResultsWithPagination(options, page, resultList) { | |
resultList = resultList || []; | |
page = page || 1; | |
return new Promise((resolve, reject) => { | |
makeHttpRequestPromise(Object.assign({}, options, { page: page })) | |
.then(payload => { | |
const newResultList = resultList.concat(payload); | |
if (payload.length >= options.per_page) { |
$ docker-compose up
root
/ mypassword
-- Read more about this program in the official Elm guide: | |
-- https://guide.elm-lang.org/architecture/user_input/buttons.html | |
import Html exposing (beginnerProgram, div, button, text, input) | |
import Html.Attributes exposing (class) | |
import Html.Events exposing (onClick, onInput) | |
import String exposing (toInt) | |
{- | |
import Result exposing (..) | |
-} |
/* Sometimes it's pretty easy to run ito troubles with React ES6 components. | |
Consider the following code: */ | |
class EventStub extends Component { | |
componentDidMount() { | |
window.addEventListener('resize', this.onResize.bind(this)); //notice .bind | |
} | |
componentWillUnmount() { | |
window.removeEventListener('resize', this.onResize.bind(this)); |
image: kkarczmarczyk/node-yarn:6.9 | |
cache: | |
paths: | |
- webapp/node_modules/ | |
- vendor/apt | |
e2e_tests: | |
before_script: | |
# install chrome |
Using pg.connect
is the way to go in a web environment.
PostgreSQL server can only handle 1 query at a time per connection. That means if you have 1 global new pg.Client()
connected to your backend your entire app is bottleknecked based on how fast postgres can respond to queries. It literally will line everything up, queuing each query. Yeah, it's async and so that's alright...but wouldn't you rather multiply your throughput by 10x? Use pg.connect
set the pg.defaults.poolSize
to something sane (we do 25-100, not sure the right number yet).
new pg.Client
is for when you know what you're doing. When you need a single long lived client for some reason or need to very carefully control the life-cycle. A good example of this is when using LISTEN/NOTIFY
. The listening client needs to be around and connected and not shared so it can properly handle NOTIFY
messages. Other example would be when opening up a 1-off client to kill some hung stuff or in command line scripts.