Skip to content

Instantly share code, notes, and snippets.

Samuel Martins sfelix-martins

View GitHub Profile
@sfelix-martins
sfelix-martins / Envoy.blade.php
Last active February 26, 2018 13:23
Envoy script to create virtual host configuration in your server with nginx. The structure `/srv/site.com/www` is used.
@servers(['server' => '[email protected]']) {{-- Your server ip address --}}
@task('up', ['on' => 'server'])
cd /etc/nginx/sites-available
echo -e "server {
\t listen 80;
\t listen [::]:80;
\t root /srv/{{ $site }}/www;
@sfelix-martins
sfelix-martins / Envoy.blade.php
Created February 26, 2018 15:40
Envoy script to create virtual host to up Laravel applications configuration in your server with nginx. The structure `/srv/site.com/www` is used.
@servers(['server' => '[email protected]']) {{-- Your server ip address --}}
@task('up', ['on' => 'server'])
cd /etc/nginx/sites-available
echo -e "server {
\t listen 80;
\t listen [::]:80;
\t root /srv/{{ $site }}/www/public;
useEffect(() => {
if (products.length > 0) {
return;
}
const [request, cancel] = getProductsRequest();
let isSubscribed = true;
async function fetchProducts() {
// https://stackoverflow.com/a/45322101
function object_value(key, obj) {
return key.split('.').reduce(function(prev, curr) {
return prev ? prev[curr] : null
}, obj || self)
}

Usage

Paste the gist code in your .zshrc or .bashrc and run source ~/.zshrc or source ~/.bashrc.

Every time you switch the internet adapter you must run source ~/.zshrc again.

@sfelix-martins
sfelix-martins / gist:6ba3bd0b00f6c245f9d0d52fbcb99d67
Last active June 16, 2020 14:11
Rascunho de um bot para agendar vistoria no DETRAN-DF