Skip to content

Instantly share code, notes, and snippets.

Avatar

Glauber Mota glauberm

View GitHub Profile
@glauberm
glauberm / Notification.jsx
Last active Nov 25, 2019
Very simple React notifications using Context with synced CSS animations
View Notification.jsx
import React from 'react';
export default class Notification extends React.PureComponent {
constructor(props) {
super(props);
this.timeoutSlideOut;
this.timeoutDismiss;
this.state = {
active: false,
slideOut: false,
@glauberm
glauberm / colors.scss
Created Jan 16, 2019
Color Palette Generator
View colors.scss
// Source: https://news.ycombinator.com/item?id=18421755
$palettes: (
blue: (
lightest: hsl(201, 75%, 66%),
lighter: hsl(201, 75%, 61%),
light: hsl(201, 75%, 56%),
base: hsl(201, 75%, 51%),
dark: hsl(201, 75%, 46%),
darker: hsl(201, 75%, 41%),
@glauberm
glauberm / RandomAlgebraicExpression.js
Created Nov 21, 2018
Generates a random algebraic expression with two random terms and its result. The terms have a maximum of two numerical digits max and are never zero.
View RandomAlgebraicExpression.js
class RandomAlgebraicExpression
{
constructor() {
this.operations = [
this.addition,
this.subtraction,
this.multiplication,
this.division
];
this.x = this.getRandomInt(-99, 100);
You can’t perform that action at this time.