Skip to content

Instantly share code, notes, and snippets.

Working from home

Igor Vieira IgorVieira

Working from home
View GitHub Profile
IgorVieira /
Created Jan 14, 2021 — forked from mayank23/
Jest Mock Any Property on Window Utility - with automatic cleanup

Jest Mock Any Property on Window Utility - with automatic cleanup.

IgorVieira /
Last active Aug 26, 2020
Test front-end Devborne

Teste front-end

Nesse teste, nós queremos que seja feita uma lista dos repositórios com stars do Github onde para cada repositório selecionado seja possível adicionar um comentário ao mesmo por usuário, isso utilizando react, com uma api em rest ou graphql, o que é esperado desse teste:


  • Testes unitários.
  • Uso de Create React App.
  • Que tenha autenticação para o acesso a aplicação e listagem do mesmo.
  • Seja possível ver uma lista de repositórios.
View Devborne Backend

Backend Coding Challenge

Design an API that save game speedruns and serves a leaderboard.


In several games, finishing the game is deemed just too easy for some gamers, so they decide to see how fast they can finish the entire game. In fact, speedruns became so popular that many players compete with other players to see if they can break each other records, even if that means beating the time by just a couple of seconds. We want to create an API that can registers those records and also serve a leaderboard.


View docker-compose.yml
image: postgres:9.6-alpine
- '5432:5432'
POSTGRES_DB: 'database'
- ./init:/docker-entrypoint-initdb.d/
IgorVieira / gist:5c1041fcff865dd54f48ab9924644596
Created Jun 7, 2018 — forked from bergus/gist:1387854
Correct easiest way to find duplicate values in a JavaScript array - Native unique function implementation
View gist:5c1041fcff865dd54f48ab9924644596
* I saw this thread:
* The solutions from gist:1305056 were elegant, but wrong. So here's mine:
Array.prototype.unique = function(test) {
/* returns a new, sorted Array without duplicates */
if (!Array.isArray(this))
throw new TypeError("Array.prototype.unique must be called on an Array");
return this.slice(0).sort().filter( typeof test == "function"
? function(v, i, a) { return !i || !test(v, a[i-1]); }
IgorVieira / settings.json
Last active Sep 30, 2020
Vscode settings
View settings.json
"editor.fontFamily": "Operator Mono, Menlo, Monaco, 'Courier New', monospace",
"editor.fontSize": 12,
"editor.lineHeight": 25,
"editor.letterSpacing": 0.5,
"files.trimTrailingWhitespace": true,
"editor.fontWeight": "400",
"prettier.eslintIntegration": true,
"editor.cursorStyle": "line",
"editor.cursorWidth": 5,
IgorVieira /
Last active Oct 22, 2017
Set path for rbenv in your zsh on Ubuntu

zsh + Ruby(rbenv) on Ubuntu

If yout have problems for check ruby versions on your ubuntu + zsh, just put this in your terminal and set path for your rbenv

$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv
$ echo 'eval "$(rbenv init -)"' >> ~/.zshenv
IgorVieira / convert.js
Last active Sep 25, 2017
Convert files html.slim for html.erb
View convert.js
const { exec } = require('child_process')
const fs = require('fs')
const rl = require('readline')
const i = rl.createInterface(
View upbutton.min.js
$(document).ready(function(){var b=700;$(window).scroll(function(){$(this).scrollTop()>220?$(".topo").fadeIn(b):$(".topo").fadeOut(b)}),$(".topo").click(function(a){return a.preventDefault(),jQuery("html, body").animate({scrollTop:0},b),!1})});