Skip to content

Instantly share code, notes, and snippets.

View washingtonsoares's full-sized avatar
🎯
Focusing

Washington Soares washingtonsoares

🎯
Focusing
View GitHub Profile
import 'styled-components';
import { ThemeScheme } from 'core/assets/themes';
declare module 'styled-components' {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface DefaultTheme extends ThemeScheme {}
}
import dayjs from 'dayjs';
jest.mock("dayjs", () => {
const format = jest.fn(() => '02:58:33');
return jest.fn().mockImplementation(() => ({
format
}))
})
var express = require('express');
const proxy = require('http-proxy-middleware');
var cors = require('cors')
var app = express();
app.use(cors())
app.use(
'/api',
proxy.createProxyMiddleware({
@washingtonsoares
washingtonsoares / example.js
Created January 20, 2020 18:17 — forked from jcarroll2007/example.js
React Intersection Observer Hook: `useIsElementInView`
import React from 'react'
import useIsElementInView from './useIsElementInView'
export function Example() {
const { ref, isInView } = useIsElementInView()
return (
<div ref={ref}>
{isInView ? 'It is in the view!' : 'Not in view (so you cant really even tell if it works I guess...)'}
</div>
@washingtonsoares
washingtonsoares / google_dinosaur.js
Created December 1, 2019 21:51
Google Dinosaur Game
// Copyright (c) 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(function() {
'use strict';
/**
* T-Rex runner.
* @param {string} outerContainerId Outer containing element id.
* @param {Object} opt_config
* @constructor
@washingtonsoares
washingtonsoares / interview.md
Last active August 7, 2019 17:57
Alguns tópicos úteis para entrevistas de Frontend

Framework Angular

  • TypeScript
  • Biblioteca RXJS (conhecimento avançado é um excelente indicativo)
  • Carregamento de módulos sob demanda (lazy loading)

JavaScript

  • Qual das novas features do JavaScript mais te chama atenção ? (citar várias é um bom indicativo)
  • Qual abordagem você usa na hora de escolher entre um framework (Angular, React, Vuejs, etc) para iniciar um projeto ?

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@washingtonsoares
washingtonsoares / rails_annotations.md
Created May 10, 2018 01:39 — forked from daltonjorge/rails_annotations.md
Explicações de conceitos do Rails e outras infos úteis.

Active Record

É um design pattern que o Rails implementa a partir da gem ActiveRecord.

Serve para conectar a camada Model da aplicação com tabelas do database, para assim criar um modelo de domínio persistível, onde a lógica (Model) e dados (BD) são apresentados em uma única solução.

Já persiste no BD:

obj.create
const MyLoader = () => (
<ContentLoader
height={200}
width={400}
speed={2}
primaryColor={"#f3f3f3"}
secondaryColor={"#ecebeb"}
>
<rect x="3" y="88" rx="3" ry="3" width="42" height="10" />
<rect x="50.83" y="88" rx="3" ry="3" width="60" height="10" />
#!/bin/bash
serverAmount=$1
initialThriftPort=$2
initialCopyCatPort=$3
for ((number=0; number < $serverAmount; number++)){
port=$((initialThriftPort+number))
mvn exec:java -Dexec.mainClass=chavevalor.ChaveValorServer -Dexec.args="$port $number $serverAmount $initialThriftPort" &
}