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
@rogeriopradoj
rogeriopradoj / routing_gonzalo123.php
Last active December 12, 2018 10:54
routing.php - rewrite urls using php built in web server
<?php
// www/routing.php
// http://gonzalo123.com/2012/10/15/how-to-rewrite-urls-with-php-5-4s-built-in-web-server/
if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER["REQUEST_URI"])) {
return false;
} else {
include __DIR__ . '/index.php';
}
// cd ./
@matheus-santos
matheus-santos / banks_BR.json
Created April 13, 2016 15:32
Lista de bancos que operam no Brasil
[
{
"code": "001",
"name": "Banco do Brasil",
"short_name": "BB",
"jurisdiction": "Federal",
"website": "www.bb.com.br"
},
{
"code": "002",
@k33g
k33g / index.html
Last active April 18, 2019 05:49
Vue.js + ES6
<div id="demo">
<h1>{{bob.fields.firstName}} {{bob.fields.lastName}}</h1>
</div>
<ul id="humans-list">
<li v-repeat="humans">
{{fields.firstName}} {{fields.lastName}}
</li>
</ul>
@Woodsphreaker
Woodsphreaker / primeNumbers.js
Created March 14, 2017 14:35
Dado um número aleatório, retornar todos os números PRIMOS entre 0 e o número escolhido
"use strict";
const divisors = [1, 2, 3, 4, 5, 6, 7, 8, 9];
const max = Math.max.apply(null, divisors);
const base = (num) => num > max ? [].concat(divisors, num) : divisors;
const numbers = (num) => [...Array(num).keys()];
const numberTest = (num) => base(num).map((_a) => num % _a === 0).filter(_a => _a === true);
const prime = (num) => numbers(num).filter(_a => numberTest(_a).length === 2);
console.log(prime(100)); // [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
@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">
@vinicius73
vinicius73 / Dockerfile
Last active August 15, 2019 22:21
Node project with PM2 and Docker
FROM node:10.15-alpine as base
RUN apk --no-cache --virtual build-dependencies add \
python \
make \
g++ \
&& rm -f /var/cache/apk/* \
&& npm config set unsafe-perm true \
&& npm install --quiet node-gyp -g --cache /tmp/empty-cache
@sistematico
sistematico / callback.php
Last active November 6, 2019 19:19
XMLHttpRequest Examples
<?php
$array = array(
array('texto'=>'Olá ' . $_POST['nome'] . '!'),
array('texto'=>'Bem-vindo(a) ' . $_POST['nome']),
array('texto'=>'Tudo bem ' . $_POST['nome'])
);
echo json_encode($array);
@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)
@vinicius73
vinicius73 / atom.md
Last active July 13, 2020 21:44
My default Atom packages and theme
@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)