Skip to content

Instantly share code, notes, and snippets.

View igorvieira's full-sized avatar
🏠
Working from home

Igor Vieira igorvieira

🏠
Working from home
View GitHub Profile
@igorvieira
igorvieira / introrx.md
Created November 22, 2015 00:17 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@igorvieira
igorvieira / topkeywords.js
Created October 5, 2016 15:52 — forked from elliotbonneville/topkeywords.js
Find top keywords associated with a Google search with this Node.js application.
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
@igorvieira
igorvieira / upbutton.js
Created April 29, 2017 11:54
up-button
$(document).ready(function(){
var offset = 220;
var duration = 700;
$(window).scroll(function() {
if ($(this).scrollTop() > offset) {
$('.topo').fadeIn(duration);
} else {
$('.topo').fadeOut(duration);
}
});
$(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})});
@igorvieira
igorvieira / convert.js
Last active September 25, 2017 12:49
Convert files html.slim for html.erb
const { exec } = require('child_process')
const fs = require('fs')
const rl = require('readline')
const i = rl.createInterface(
process.stdin,
process.stdout,
null
);
@igorvieira
igorvieira / gist:5c1041fcff865dd54f48ab9924644596
Created June 7, 2018 20:36 — forked from bergus/gist:1387854
Correct easiest way to find duplicate values in a JavaScript array - Native unique function implementation
/*
* I saw this thread: http://stackoverflow.com/questions/840781/easiest-way-to-find-duplicate-values-in-a-javascript-array
* 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]); }

Backend Coding Challenge

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

Background

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.

Requirements

/* This is intentionally blank just and exists to secure a decent gist name */
@igorvieira
igorvieira / test-devborne.md
Last active August 26, 2020 22:21
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:

Obrigatórios:

  • 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.
@igorvieira
igorvieira / README.md
Created January 14, 2021 17:43 — forked from mayank23/README.md
Jest Mock Any Property on Window Utility - with automatic cleanup

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