Skip to content

Instantly share code, notes, and snippets.

View rodrigocnascimento's full-sized avatar
🐯
i'm a turtle

Rodrigo Nascimento rodrigocnascimento

🐯
i'm a turtle
View GitHub Profile
@joaocunha
joaocunha / How To Hide The Select Arrow On Firefox.md
Last active December 10, 2023 13:05
How to hide <select> dropdown's arrow in Firefox when using "-moz-appearance: none;".

This is no longer a bug. I'm keeping the gist for historical reasons, as it helped to get it fixed. Make sure to read the notes by the end of the post.

How to remove hide the select arrow in Firefox using -moz-appearance:none;

TL;DR (or, the fix)

  1. Set -moz-appearance to none. This will "reset" the styling of the element;
  2. Set text-indent to 0.01px. This will "push" the text a tiny bit[1] to the right;
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@joaoneto
joaoneto / correios.js
Last active July 27, 2017 19:28
Track para os correios
var http = require('http');
var parseTrack = function (data) {
var trackLines = data.replace(/[\r\n]/g, '').replace(/<\/tr>/gi, '</tr>\n').match(/<tr.*?>(.*)<\/tr>/gi);
trackLines.shift();
var parsed = [], parts = [];
var length = trackLines.length;
var details, date, track;
while (length--) {
@alganet
alganet / tipagem_primitiva.md
Last active August 12, 2019 22:48
PHP Prático: Tipagem Primitiva

PHP Prático: Tipagem Primitiva

A primeira coisa a saber sobre a tipagem do PHP é que ela não é parecida com Java, JavaScript, Python, Ruby, C, C++, C# ou qualquer linguagem que tenha uma tipagem baseada em alguma dessas citadas. A tipagem do PHP é incomparável, e assim como tudo que não pode ser comparado é difícil de ser explicada.

De qualquer forma, a tipagem do PHP é extremamente simples se você apenas confiar na sua intuição. A primeira coisa que você tem que saber sobre a tipagem do PHP é que ela faz malabarismos. É exatamente essa a palavra: malabarismo. E o PHP é um ótimo malabarista, exceto por alguns poucos deslizes fáceis de decorar. O type juggling, traduzido para "malabarismo com tipos" é a habilidade que o PHP tem de tomar decisões intuitivas sobre conversões de tipos. Em termos grosseiros, o PHP decide toda e qualquer tipagem de variáveis em tempo de execução, não compilação (pros pedante aí que tão lendo).

Note bem: tipagem de variáveis. O PHP é multi-paradigma e, ao m

@alganet
alganet / php_pratico_streams.md
Last active August 15, 2021 20:41
PHP Prático: Streams

PHP Prático: Streams

A palavra stream significa corrente. Em geral, qualquer conexão de rede é uma stream, e existem vários tipos de protocolos para streams. Esses protocolos definem como os dados fluem na corrente.

No PHP, vários protocolos são suportados de forma transparente:

<?php
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
/*
* Check all checkboxes for facebook
*/
var checks = document.getElementsByClassName("checkbox");
for(var i = 0; i < checks.length; i++){ checks[i].checked = true; }
<?php
class String
{
private $value;
public function __construct($value)
{
$this->value = $value;
}
<?php
/**
* @param integer $p Posição do usuário
* @param integer $t Total de elementos
* @param integer $q Razão da rede
* @return integer
*/
function userNetwork($p, $t, $q = 2)
{
$sigma = function($n) use ($q) { return (pow($q, $n) - 1) / ($q - 1); };
@LeaVerou
LeaVerou / dabblet.css
Created January 17, 2013 19:17
Clip image to hexagon
/**
* Clip image to hexagon
*/
img {
max-width: 200px;
max-height: 200px;
}