Skip to content

Instantly share code, notes, and snippets.

View 12afaelPereira's full-sized avatar
🎯
Focusing

Rafael Pereira 12afaelPereira

🎯
Focusing
View GitHub Profile
@12afaelPereira
12afaelPereira / Meus links úteis
Last active August 23, 2020 21:03
Links úteis pessoais para trabalho
function uniteUnique(arr) {
let myArr = [];
for(let i=0; i<arguments.length; i++){
for(let j=0; j< arguments[i].length; j++){
myArr.push(arguments[i][j]);
}
}
function orbitalPeriod(arr) {
let GM = 398600.4418;
let earthRadius = 6367.4447;
let T;
arr.map( (item, index) => {
item.orbitalPeriod = Math.round( 2 * Math.PI * (Math.sqrt( Math.pow(earthRadius+arr[index].avgAlt , 3) / GM)) )
})
arr.map(item => delete item.avgAlt)
function binaryAgent(str) {
const strBinaryArray = str.split(" ")
const strDecimalArray = strBinaryArray.map(binary => parseInt(binary, 2).toString(10))
return strDecimalArray.map(decimal => String.fromCharCode(decimal)).join("")
}
@12afaelPereira
12afaelPereira / JavaScript Array Manipulation
Created May 18, 2019 00:11
list of links about common js array methods
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findindex
@12afaelPereira
12afaelPereira / System Design.md
Created March 28, 2019 00:36 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@12afaelPereira
12afaelPereira / media-query.css
Created February 19, 2019 23:15 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@12afaelPereira
12afaelPereira / The Technical Interview Cheat Sheet.md
Created August 16, 2016 03:31 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.