Skip to content

Instantly share code, notes, and snippets.

View johnatandias's full-sized avatar
👨‍👩‍👧‍👦
No success compensates for your family's failure.

Johnatan Dias johnatandias

👨‍👩‍👧‍👦
No success compensates for your family's failure.
View GitHub Profile
@johnatandias
johnatandias / minify.js
Created April 26, 2020 14:19
Minify HTML files with Javascript
const html = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Document</title>
</head>
@johnatandias
johnatandias / clean_code.md
Last active February 21, 2020 21:59 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

O código é limpo se puder ser entendido facilmente por todos da equipe. O código limpo pode ser lido e aprimorado por um desenvolvedor que não seja o autor original. Com capacidade de compreensão, vem a legibilidade, a capacidade de mudança, a extensibilidade e a manutenção.


Regras gerais

  1. Siga as convenções padrão.
  2. Mantenha isso simples, estúpido.
    • Mais simples é sempre melhor.
  • Reduza a complexidade o máximo possível.
@johnatandias
johnatandias / input.scss
Created December 27, 2019 20:48
BLiP Design System - Input
@mixin size($size) {
width: $size;
height: $size;
}
.bds-icon {
display: inline-flex;
align-items: center;
svg {
@johnatandias
johnatandias / listenToAllEvents.js
Last active June 25, 2020 23:25
Listen to all events
(() => {
Object.keys(window).map(property => {
if (property.startsWith('on')) {
window[property] = event => console.log('=>', event.type, { event })
}
})
})()
import svelte from 'rollup-plugin-svelte';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import livereload from 'rollup-plugin-livereload';
import { terser } from 'rollup-plugin-terser';
import { scss } from '@kazzkiq/svelte-preprocess-scss';
const production = !process.env.ROLLUP_WATCH;
export default {
@johnatandias
johnatandias / DatabaseService.js
Created July 11, 2019 22:32
A simple example of indexedDB for KaiOS devices
class DatabaseProvider {
constructor() {
this.db = {};
this.dbName = 'todos';
this.dbVersion = 1;
this.stores = { TODOS: 'todos' };
this.init();
}
init() {
@johnatandias
johnatandias / Input.js
Last active July 5, 2019 00:47
KaiOS navigation with React Hooks
import React from 'react';
import css from './Input.module.css'
export const Input = ({ label, type }) => {
return (
<div className={css.content}>
<input className={css.input} type={type} nav-selectable="true" />
<label className={css.label}>{label}</label>
</div>
)
@johnatandias
johnatandias / x1.cfg
Created July 1, 2019 20:26
CS:GO - X1
bot_kick
mp_freezetime 0
mp_free_armor 1
mp_startmoney 50000
mp_buy_anywhere 1
mp_buytime 99999
mp_maxmoney 50000
mp_round_restart_delay 2
mp_maxrounds 50
mp_warmup_end
@johnatandias
johnatandias / treino.cfg
Created July 1, 2019 20:20
CS:GO - Treino
sv_cheats 1
sv_infinite_ammo 2
ammo_grenade_limit_total 5
sv_showimpacts 1
mp_buytime 9999
mp_buy_anywhere 1
sv_regeneration_force_on 1
mp_warmup_end
mp_freezetime 0
mp_roundtime 60
@johnatandias
johnatandias / treino_hard.cfg
Created July 1, 2019 20:17
CS:GO Treino hard
sv_cheats 0
bot_kick
mp_autobalance 0
mp_limitteams 0
mp_startmoney 10000
bot_add_t
bot_add_t
bot_add_t
bot_add_t
bot_add_t