Skip to content

Instantly share code, notes, and snippets.

View wilcorrea's full-sized avatar
🚀
// TODO: be life good

William Correa wilcorrea

🚀
// TODO: be life good
View GitHub Profile
@jhorlima
jhorlima / DiggStylePagination.php
Last active March 20, 2018 13:10
Digg Style Pagination - Bootstrap PHP
<?php
final class DiggStylePagination {
/**
* DiggStylePagination::create(5, 1, 15, function($page){ return 'http://localhost/' . $page; })
*
*
*/
public final static function create($currentPage, $firstPage, $totalPages, \Closure $url, $adjacents = 1, array $classes = []) {
@jkrems
jkrems / es-module-history.md
Last active February 25, 2025 06:50
History of ES modules

Modules - History & Future

History

@VitorLuizC
VitorLuizC / README.md
Last active December 28, 2020 01:42
Some lodash functions replaced by ES2015+

_.compact([ ...list ])

compact function just returns a new Array without falsy values.

A filter could do the trick using a simple isTruthy expression.

[ ...list ].filter(value => value)
@vinicius73
vinicius73 / 0-contribua-.md
Last active October 17, 2024 19:32
Guia de referencias sobre estudo de JavaScript

Contribua

Se você quiser adicionar mais algum tópico deixe seu comentário, o objetico é facilitar para os iniciantes ou aqueles que buscam dominar JavaScript, quais tópicos são importantes para dominar JavaScript.

São tópicos para quem sabe o minimo de JavaScript (declarar variáveis), a ordem em que eles aparecem são por importância para o dominio como um todo. Mesmo que você já tenha experiência com JS, recomendo que leia os links de cada tópico para fortalecer suas bases teóricas e ter um comportamento mais profundo da linguagem.

Lista originalmente criada e compilada por Vinicius Reis

/**
* By Rogério M. de Queiroz([email protected])
* https://github.com/rogeriomq
* Funções de filtros diversos.
* Código inspirado nos .js de igorcosta/ng-filters-br:
* https://github.com/igorcosta/ng-filters-br/tree/master/src/brasil/filters
*/
const cpfFormatter = (input) => {
let str = input + ''
@guilhermebruzzi
guilhermebruzzi / github-net-config.md
Last active May 22, 2023 17:02
NET não libera a porta 22 e impede de acessar o github por ssh

Usar ssh do github com wifi do netcombo

A NET parece que só libera o uso de qualquer porta, como a porta 22 de ssh, para pessoa jurídica em seus novos planos (desde 2016).

Para conseguir usar o github por ssh com plano de internet da NET para pessoa física, é necessário:

Criar o arquivo ~/.ssh/config e adicionar:

Host github.com
@lbssousa
lbssousa / Example_of_use.vue
Last active July 8, 2019 10:50
Vue component wrapper around parallax-js
<template>
(...)
<parallax-scene :scalar-x="25" :scalar-y="15">
<parallax-layer :depth="0.00">
<img src="~assets/parallax/0_sun.png" style="position: relative; top: -4px;" draggable="false" alt="">
</parallax-layer>
<parallax-layer :depth="0.33">
<img src="~assets/parallax/1_mountains.png" style="position: relative; top: 40px;" draggable="false" alt="">
</parallax-layer>
<parallax-layer :depth="0.67">
@shettayyy
shettayyy / pre-commit-eslint
Last active December 10, 2021 05:27
Pre-commit hook for Linting JS with ESLint before commit.
#!/bin/sh
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$")
ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint"
if [[ "$STAGED_FILES" = "" ]]; then
exit 0
fi
PASS=true
@anabastos
anabastos / criaArrayPrimos.js
Last active January 7, 2020 00:16
Dado um número aleatório, retornar todos os números PRIMOS entre 0 e o número escolhido
const criaArrayPrimos = x =>
criaArray(x)
.slice(2)
.filter(checaFatores)
const criaArray = tamanho => Array.from({ length: tamanho }, (el, index) => index)
const checaFatores = n =>
criaArray(maiorDivisor(n))
.slice(2)
@lubien
lubien / primeNumbers.js
Last active March 14, 2017 19:40 — forked from Woodsphreaker/primeNumbers.js
Dado um número aleatório, retornar todos os números PRIMOS entre 0 e o número escolhido
const
range = x => y =>
Array.from({length: y - x})
.map((_, i) => x + i)
, {ceil, sqrt} = Math
, lt = y => x =>
x < y