- Url:
GET
/subscriptions/{subscription_id}/events - Query Parameters:
batch_limit
:-
Maximum number of Events in each chunk (and therefore per partition) of the stream.
- Default: 1
-
max_uncommitted_events
:
#!/bin/bash | |
set -e | |
# A precommit hook that uses spotless to format only staged files | |
# It also supports partially stage files using the following steps: | |
# 1. It stashed all the unstaged changes and then runs spotlessApply | |
# 2. After spotless apply is finished it applyes the stashed changes back on the code (that is also formatted/changed by spotless) | |
# 3. All the files that have conflicts due to the stash apply, it merges the conflict with the changes that are coming from the stash to not loose any new changes that were not staged |
None of the string methods modify this
– they always return fresh strings.
-
charAt(pos: number): string
ES1Returns the character at index
pos
, as a string (JavaScript does not have a datatype for characters).str[i]
is equivalent tostr.charAt(i)
and more concise (caveat: may not work on old engines).
This content moved here: https://exploringjs.com/impatient-js/ch_arrays.html#quickref-arrays
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. | |
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0." | |
Database files have to be updated before starting the server, here are the steps that had to be followed: | |
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default | |
brew unlink postgresql | |
brew install postgresql@9.6 | |
brew unlink postgresql@9.6 | |
brew link postgresql |
//Monad - a sample implementation | |
class Monad { | |
constructor(val) { | |
this.__value = val; | |
} | |
static of(val) {//Monad.of is simpler than "new Monad(val) | |
return new Monad(val); | |
}; | |
map(f) {//Applies the function but returns another Monad! | |
return Monad.of(f(this.__value)); |
This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere… I hope to present the information you need without assuming anything.
Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!
One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.
/** | |
* This short program will encrypt the user password | |
* and insert a new record into a mock database. | |
*/ | |
const Reader = require('fantasy-readers'); | |
const R = require('ramda'); | |
const crypto = require('crypto'); | |
// our mock database | |
const database = [ |
location ~* ^/(.*) { | |
set $s3_bucket = "<bucket-name>.s3-website-eu-west-1.amazonaws.com"; | |
proxy_http_version 1.1; | |
proxy_buffering off; | |
proxy_ignore_headers "Set-Cookie"; | |
proxy_hide_header x-amz-id-2; | |
proxy_hide_header x-amz-request-id; | |
proxy_hide_header x-amz-meta-s3cmd-attrs; |