YouTube video: https://www.youtube.com/watch?v=r-8isv_TnVA
Stackblitz: https://stackblitz.com/edit/js-mbehz9?file=index.js
YouTube video: https://www.youtube.com/watch?v=r-8isv_TnVA
Stackblitz: https://stackblitz.com/edit/js-mbehz9?file=index.js
#!/usr/bin/env bash | |
export $(cat .env | xargs) | |
KINESIS_STREAM_SHARDS=${KINESIS_STREAM_SHARDS:-1} | |
export USE_SSL=true | |
awslocal kinesis create-stream --shard-count ${KINESIS_STREAM_SHARDS} \ | |
--stream-name ${KINESIS_STREAM_NAME} |
<?php | |
// curl -sS https://getcomposer.org/installer | php | |
// php composer.phar require aws/aws-sdk-php | |
// export AWS_ACCESS_KEY_ID=... | |
// export AWS_SECRET_ACCESS_KEY=... | |
$streamName = '<INSERT_YOUR_STREAMNAME_HERE>'; | |
$numberOfRecordsPerBatch = 10000; |
https://golang.org/ | |
https://go.dev/ | |
https://pkg.go.dev/ | |
https://go-proverbs.github.io/ | |
https://golang.org/doc/effective_go.html | |
https://blog.golang.org/errors-are-values | |
https://github.com/golang/go/wiki/CodeReviewComments | |
https://golang.org/doc/faq | |
https://golang.org/ref/spec | |
https://blog.golang.org/constants |
PHP
Last login: Wed May 15 10:34:29 on ttys001
Vinicius-MacBook:~ vinyvicente$ wrk -t4 -c400 -d10s http://127.0.0.1:1337/
Running 10s test @ http://127.0.0.1:1337/
4 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 7.78ms 1.55ms 23.47ms 82.95%
Req/Sec 0.90k 458.32 1.57k 69.44%
* Update (12.09.2017): I have improved the trait so that it can be used with objects other than Eloquent Models.
Some days ago I came across a task where I needed to implement managable state for an Eloquent model. This is a common task, actually there is a mathematical model called "Finite-state Machine". The concept is that the state machine (SM) "can be in exactly one of the finite number of states at any given time". Also changing from one state to another (called transition) depends on fulfilling the conditions defined by its configuration.
Practically this means you define each state that the SM can be in and the possible transitions. To define a transition you set the states on which the transition can be applied (initial conditions) and the only state in which the SM should be after the transition.
That's the theory, let's get to the work.
<?php | |
$json = json_decode('[ | |
{ | |
"id":1, | |
"descricao":"Tipo de Registro 01", | |
"status_op":"status de op 01", | |
"status_atividade":"status de atividade 01", | |
"exige_atividade":false, | |
"acao_op":"Nenhum", |
The API we are creating in this gist will follow these rules :
password
Grant Type only (no need for Authorization pages and such).v1.api.example.com
)The API will be written in PHP with the Symfony 3 framework. The following SF2 bundles are used :
#change it to latest version | |
NPS_VERSION=1.11.33.0; | |
echo "Changing Directory to $HOME..." | |
cd $HOME; | |
echo "Nginx version to install: " && \ | |
read NGINX_VERSION && \ | |
echo "Downloading nginx-$NGINX_VERSION..." && \ | |
wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \ | |
echo "Installing Nginx Dependencies..." && \ |