Skip to content

Instantly share code, notes, and snippets.

View vmesel's full-sized avatar
💭
I may be slow to respond.

Vinicius Mesel vmesel

💭
I may be slow to respond.
View GitHub Profile
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "tap-name discover",
"type": "python",
"request": "launch",
.:: POSTGRES: DROP/CREATE DATABASE
NOTICE: database "prest-test" does not exist, skipping
DROP DATABASE
CREATE DATABASE
.:: POSTGRES: LOAD DATA SCHEMA
CREATE TABLE
func (adapter *Postgres) QueryCtx(ctx context.Context, SQL string, params ...interface{}) (sc adapters.Scanner) {
// use the db_name that was set on request to avoid runtime collisions
db, err := getDBFromCtx(ctx)
if err != nil {
log.Errorln(err)
return &scanner.PrestScanner{Error: err}
}
p, err := Prepare(db, SQL)
if err != nil {
log.Errorln(err)
// Based On https://github.com/chrisdavidmills/push-api-demo/blob/283df97baf49a9e67705ed08354238b83ba7e9d3/main.js
var isPushEnabled = false,
registration,
subBtn;
window.addEventListener('load', function() {
subBtn = document.getElementById('webpush-subscribe-button');
subBtn.addEventListener('click',
@vmesel
vmesel / .zshrc
Created September 17, 2020 14:33
.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/viniciusmesel/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

Desafio - IP Válido

Escreva uma função para checar se uma string é um IPv4 ou IPv6 válidos.

Os endereços IPv4 são canonicamente representados na notação decimal com pontos, que consiste em quatro números decimais, cada um variando de 0 a 255, separados por pontos ("."), Por exemplo, 172.16.254.1;

Além disso, zeros à esquerda no IPv4 são inválidos. Por exemplo, o endereço 172.16.254.01 é inválido.

javascript:(function(d){var w=d.documentElement.offsetWidth,t=d.createTreeWalker(d.body,NodeFilter.SHOW_ELEMENT),b;while(t.nextNode()){b=t.currentNode.getBoundingClientRect();if(b.right>w||b.left<0){t.currentNode.style.setProperty('outline','1px dotted red','important');console.log(t.currentNode);}};}(document));
version: 2 # use CircleCI 2.0
jobs: # A basic unit of work in a run
build: # runs not using Workflows must have a `build` job as entry point
# directory where steps are run
working_directory: ~/pyjobs
docker: # run the steps with Docker
# CircleCI Python images available at: https://hub.docker.com/r/circleci/python/
- image: circleci/python:3.6.4
environment: # environment variables for primary container
SECRET_KEY: THIS_IS_NOT_A_SECRET
#install.packages("data.table")
#install.packages("zoo")
#install.packages("sqldf")
#install.packages("mongolite")
#library(data.table)
#library(zoo)
library(sqldf)
library(mongolite)
client_id <- "ABC"
install.packages("mongolite") # Instala o mongolite (biblioteca de conn com o mongo)
install.packages("tidyverse") # Instala o Tidyverse (biblioteca de filtros e aggs)
library(mongolite)
library(tidyverse)
# Pega cotacoes no MongoDB