Skip to content

Instantly share code, notes, and snippets.

View erickvictor's full-sized avatar

Erick Victor de Melo Bernardo erickvictor

View GitHub Profile
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
const page = await browser.newPage();
await page.goto('http://facebook.com');
await page.waitFor(3000);
await page.waitForSelector('#email');
await page.type('#email', 'seu@mail.com', { delay: 100 });
@erickvictor
erickvictor / App.js
Created April 14, 2022 20:03
Example Chart with VictoryJS
import {
VictoryBar,
VictoryChart,
VictoryAxis,
VictoryTheme,
VictoryStack,
VictoryTooltip
} from "victory";
const data2012 = [
@erickvictor
erickvictor / arch.sh
Created April 30, 2021 01:11 — forked from eddmann/arch.sh
Arch Setup (with Awesome)
wifi-menu
ping www.google.com
# setup disk partitions
cfdisk.
# format disk partitions
lsblk /dev/sda
mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda2
var curr = new Date; // get current date
var first = curr.getDate() - curr.getDay(); // First day is the day of the month - the day of the week
var last = first + 13; // last day is the first day + 13
var firstday = new Date(curr.setDate(first)).toUTCString();
var lastday = new Date(curr.setDate(last)).toUTCString();
firstday
"Mon, 25 May 2020 01:05:49 GMT"
lastday
Hora Piloto Nº Volta Tempo Volta Velocidade média da volta
23:49:08.277 038 – F.MASSA 1 1:02.852 44,275
23:49:10.858 033 – R.BARRICHELLO 1 1:04.352 43,243
23:49:11.075 002 – K.RAIKKONEN 1 1:04.108 43,408
23:49:12.667 023 – M.WEBBER 1 1:04.414 43,202
23:49:30.976 015 – F.ALONSO 1 1:18.456 35,47
23:50:11.447 038 – F.MASSA 2 1:03.170 44,053
23:50:14.860 033 – R.BARRICHELLO 2 1:04.002 43,48
23:50:15.057 002 – K.RAIKKONEN 2 1:03.982 43,493
23:50:17.472 023 – M.WEBBER 2 1:04.805 42,941
@erickvictor
erickvictor / docker-compose.yml
Created October 14, 2019 18:52
Rails+Postgres+Ngrok
version: '3'
services:
db:
image: postgres
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/myapp
ports:
payload=%7B%22action%22%3A%22opened%22%2C%22issue%22%3A%7B%22url%22%3A%22https%3A%2F%2Fapi.github.com%2Frepos%2Ferickvictor%2Fwebhooks%2Fissues%2F1%22%2C%22repository_url%22%3A%22https%3A%2F%2Fapi.github.com%2Frepos%2Ferickvictor%2Fwebhooks%22%2C%22labels_url%22%3A%22https%3A%2F%2Fapi.github.com%2Frepos%2Ferickvictor%2Fwebhooks%2Fissues%2F1%2Flabels%7B%2Fname%7D%22%2C%22comments_url%22%3A%22https%3A%2F%2Fapi.github.com%2Frepos%2Ferickvictor%2Fwebhooks%2Fissues%2F1%2Fcomments%22%2C%22events_url%22%3A%22https%3A%2F%2Fapi.github.com%2Frepos%2Ferickvictor%2Fwebhooks%2Fissues%2F1%2Fevents%22%2C%22html_url%22%3A%22https%3A%2F%2Fgithub.com%2Ferickvictor%2Fwebhooks%2Fissues%2F1%22%2C%22id%22%3A504771721%2C%22node_id%22%3A%22MDU6SXNzdWU1MDQ3NzE3MjE%3D%22%2C%22number%22%3A1%2C%22title%22%3A%22Teste%22%2C%22user%22%3A%7B%22login%22%3A%22erickvictor%22%2C%22id%22%3A26152785%2C%22node_id%22%3A%22MDQ6VXNlcjI2MTUyNzg1%22%2C%22avatar_url%22%3A%22https%3A%2F%2Favatars3.githubusercontent.com%2Fu%2F26152785%3Fv%3D4%22%2C%22grav
[{
"payload":
{
"action": "opened",
"issue": {
"url": "https://api.github.com/repos/erickvictor/webhooks/issues/1",
"repository_url": "https://api.github.com/repos/erickvictor/webhooks",
"labels_url": "https://api.github.com/repos/erickvictor/webhooks/issues/1/labels{/name}",
"comments_url": "https://api.github.com/repos/erickvictor/webhooks/issues/1/comments",
"events_url": "https://api.github.com/repos/erickvictor/webhooks/issues/1/events",
yarn run v1.15.2
$ jest --testPathPattern service_test
FAIL src/libs/country/__tests__/country_service_test.js (9.554s)
CountryService test
√ has a module (5ms)
listCountries test
× lists Countries (77ms)
createCountry test
√ creates a country (4ms)