Skip to content

Instantly share code, notes, and snippets.

View theuves's full-sized avatar
👋
Available for hire

Matheus Alves theuves

👋
Available for hire
View GitHub Profile
@theuves
theuves / userstyle.css
Last active February 11, 2018 20:08
Userstyle para melhorar o <tableless.com.br>.
body {
margin: 0px 15%;
margin-bottom: 200px;
}
small {
color: gray;
}
#tb-header {
@theuves
theuves / preencher.js
Last active December 30, 2017 03:07
Preencher números de um array com base no número mais comprido.
"use strict"
/**
* preencher.js
* Matheus Alves | 2017
*
* Preencher números de um array
* com base no número mais comprido.
*
* Exemplo:
@theuves
theuves / destacar.js
Last active February 11, 2018 20:05
Deixar em negrito os principais dígitos de um número de processo.
function destacar(processo) {
return processo.replace(/([^0]+\d-\d{2})/, function (numero) {
return numero.bold();
});
}
@mixin ggl-font($family) {
$url: "https://fonts.googleapis.com/css?family=" + $family;
@import url(unquote($url));
}
(function (angular) {
"use strict";
angular
.module("preencher", [])
.filter("preencher", preencher);
function () {
return function (str, pad) {
return str
@mixin gradiente($direcao, $cor, $escuridao) {
$cor-escura: darken($cor, $escuridao);
background-image: linear-gradient(
to $direcao,
$cor,
$cor-escura
);
}
@theuves
theuves / index.html
Last active February 11, 2018 20:13
Exibir mensagens quando passar o mouse em um elemento.
<style>
body {
font-family: sans-serif;
}
.msg {
padding: 2px 6px;
border-radius: 2px;
font-size: 12px;
background-color: #eee;
}
@theuves
theuves / index.js
Last active February 11, 2018 20:12
A better `localStorage`.
"use strict";
class LocalStorage {
constructor(prefix) {
this.prefix = prefix + "-";
}
getItem(name) {
return JSON.parse(localStorage.getItem(this.prefix + name));
}
hasItem(name) {
@theuves
theuves / textarea.js
Last active February 20, 2018 20:29
Aumentar ou diminuir automaticamente a altura de um <textarea>.
;(function () {
"use strict";
function addEvent(textarea) {
textarea.style.overflow = "hidden";
function updateHeight() {
var offset = textarea.offsetHeight - textarea.clientHeight;
textarea.style.height = "auto";
@theuves
theuves / animation.html
Last active February 11, 2018 20:11
Uma simples animação para aguardar o carregamento de imagens.
<style>
@keyframes change {
from {background-color: #eee;}
to {background-color: #f4f4f4;}
}
.img {
position: relative;
border: solid 2px #ddd;
width: 300px;
height: 300px;