Skip to content

Instantly share code, notes, and snippets.

View vquaiato's full-sized avatar
:octocat:
am I working?

Vinicius Quaiato vquaiato

:octocat:
am I working?
View GitHub Profile
@vquaiato
vquaiato / scrapper.go
Last active July 2, 2020 00:25
Scrapper/monitor a PC build price on https://meupc.net
package main
import (
"fmt"
"log"
"os/exec"
"regexp"
"github.com/gocolly/colly/v2"
)
{
nome: itens[0].receita.nome,
...
ingredientes: //aquele map vai aqui
...
} as ReceitaCompleta
@vquaiato
vquaiato / foo.ts
Created May 26, 2020 00:21
mapping in TS
items.map((item) => {
return {
nome: item.nome,
quantidade: item.quantidade,
unidade: item.unidade
} as Ingrediente
});
@vquaiato
vquaiato / papo_experiencia.txt
Created May 24, 2020 03:27
Um papo sobre experiência na live
senior é quem tem cicatriz
Experiência
- estudos
- Orientação a Objetos
- Padrões
- Design Patterns
- Padrões de arquitetura de aplicações
- Design de código
@vquaiato
vquaiato / hello_array.cpp
Created May 22, 2020 04:36
passing arrays to functions cpp
#include <iostream>
#include <vector>
#include <string>
using namespace std;
void foo(string meu_array[], int size)
{
for(int i = 0; i < size; i++){
cout << " " << meu_array[i];
@vquaiato
vquaiato / programacao-funcional.md
Last active May 25, 2020 01:24
Como venci o medo e comecei a estudar (e entender) Programação Funcional

Como venci o medo e comecei a estudar (e entender) Programação Funcional

@vquaiato
vquaiato / .zshrc
Created August 23, 2018 02:15
.zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/vquaiato/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
#!/usr/bin/env bash
cat cards.txt | while read card; do
clean=$(echo $card | sed 's/ /+/g' | sed "s/[',]//g")
url=$(echo "https://api.scryfall.com/cards/named\?exact\=${clean}")
echo "${card};$(curl -s "{$url}" | jq -r '.usd' | sed 's/\./,/g')"
done
@vquaiato
vquaiato / gist:677e6dc189b45892d5a338057b3c2f76
Created May 5, 2018 14:48
Scryfall planeswalkers fetcher
brew install jq
curl -s https://api.scryfall.com/cards/search\?q\=t%3Aplaneswalker | jq -r '.data[].name'
@vquaiato
vquaiato / startup_extension.cs
Created October 7, 2016 12:41
Extension for ASP.NET Core Startup to return 401 on unauthorized API calls
public static IApplicationBuilder Use401ForUnauthorizedApiCalls(this IApplicationBuilder app)
{
app.Use(async (context, next) =>
{
if (context.Request.Path.Value.Contains("/api") &&
(context.User == null ||
context.User.Identity == null ||
!context.User.Identity.IsAuthenticated))
{
context.Response.StatusCode = 401;