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 / Coffee.js
Created March 10, 2021 14:05 — forked from agneym/Coffee.js
Buy me a Coffee with React and Styled Components
import React from 'react';
import styled from 'styled-components';
const Button = styled.a`
line-height: 2;
height: 5rem;
text-decoration: none;
display:inline-flex;
color: #FFFFFF;
background-color: #FF813F;
@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.

/* This is intentionally blank just and exists to secure a decent gist name */
@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]); }
@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 / introrx.md
Created November 22, 2015 00:17 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing