Skip to content

Instantly share code, notes, and snippets.

View leandronascimento's full-sized avatar
🎯
Focusing

Leandro Nascimento leandronascimento

🎯
Focusing
View GitHub Profile
[alias]
ci = commit
co = checkout
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
@leandronascimento
leandronascimento / CategoryHelper.php
Created October 3, 2019 04:10 — forked from kaianuar/CategoryHelper.php
Using spatie/crawler and crawl a page and retrieve all links within that page.
<?php
namespace App\Http\Crawler;
use Spatie\Crawler\CrawlObserver;
use GuzzleHttp\Exception\RequestException;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;
use Symfony\Component\DomCrawler\Crawler as DomCrawler;

Keybase proof

I hereby claim:

  • I am leandronascimento on github.
  • I am fleandron (https://keybase.io/fleandron) on keybase.
  • I have a public key ASCnhGwwlg43MeXIKBW_QJ4r4qHOTimRZ47UMDU5csdA-wo

To claim this, I am signing this object:

@leandronascimento
leandronascimento / guzzle-retry.php
Created September 16, 2019 17:39 — forked from gunnarlium/guzzle-retry.php
Example of how to create a retry subscriber for Guzzle 6
<?php
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Handler\CurlHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Request as Psr7Request;
use GuzzleHttp\Psr7\Response as Psr7Response;
use Psr\Log\LoggerInterface;
const MAX_RETRIES = 2;
@leandronascimento
leandronascimento / style.css
Last active September 3, 2019 20:14 — forked from traumverloren/style.css
VSCode Customizations for Operator Mono, Fira Code, and Dark Candy Theme
/*
Instructions for MacOS:
- Install the fonts 'Operator Mono' & 'Fira Code'
- Install theme 'Dark Candy'
- Add the following config to the VS Code settings.json:
{
"editor.renderWhitespace": "all",
"editor.fontSize": 14,
@leandronascimento
leandronascimento / postman-update.sh
Created July 29, 2019 14:17 — forked from lira/postman-update.sh
Install/Update postman or postman canary (beta) for linux. Tested in ubuntu 17.10 gnome3
#!/bin/bash
cd /tmp || exit
read -r -p "[s]table or [b]eta? [sS/bB] " choice
choice=${choice,,} # tolower
if [[ ! "$choice" =~ ^(s|b)$ ]]; then
exit
fi
if [[ "$choice" = "s" ]]; then
url=https://dl.pstmn.io/download/latest/linux64
name=Postman

System

uname -a     # Display Linux System Information
uname -r     # Display kernel release information
uptime       # Show how long the system has been running + load
hostname     # Show system host name
hostname -i  # Display the IP address of the host
last reboot  # Show system reboot history
date # Show the current date and time
<scheme name="laracasts-theme-updated" version="142" parent_scheme="Default">
<option name="LINE_SPACING" value="1.7" />
<option name="EDITOR_FONT_SIZE" value="15" />
<option name="CONSOLE_FONT_NAME" value="Menlo" />
<option name="CONSOLE_FONT_SIZE" value="10" />
<option name="CONSOLE_LINE_SPACING" value="1.4" />
<option name="EDITOR_FONT_NAME" value="Menlo" />
<colors>
<option name="ADDED_LINES_COLOR" value="292d38" />
<option name="ANNOTATIONS_COLOR" value="8b999f" />
@leandronascimento
leandronascimento / default.conf
Created May 4, 2018 13:25
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;