Skip to content

Instantly share code, notes, and snippets.

@filipelinhares
filipelinhares / delete-squashed-branches.sh
Last active June 23, 2017 22:44
git delete-squashed-branches
# Put in your ~/.somethingrc file
# source: https://github.com/not-an-aardvark/git-delete-squashed
git-delete-squashed-branches () {
git checkout -q master && git for-each-ref refs/heads/ "--format=%(refname:short)" | while read branch; do mergeBase=$(git merge-base master $branch) && [[ $(git cherry master $(git commit-tree $(git rev-parse $branch^{tree}) -p $mergeBase -m _)) == "-"* ]] && git branch -D $branch; done
}
@filipelinhares
filipelinhares / pagination.js
Created June 20, 2017 05:48
Pagination with Javascript
function listItems(items, pageActual, limitItems){
let result = [];
let totalPage = Math.ceil( items.length / limitItems );
let count = ( pageActual * limitItems ) - limitItems;
let delimiter = count + limitItems;
if(pageActual <= totalPage){
for(let i=count; i<delimiter; i++){
if(items[i] != null){
result.push(items[i]);
@filipelinhares
filipelinhares / iterm.json
Created June 1, 2017 02:56
iTerm2 config
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Blue Component" : 0.9982605,
"Green Component" : 0.8627756,
"Red Component" : 0.7116503
},
@filipelinhares
filipelinhares / readme.md
Last active February 3, 2017 18:54
Telas BMS

Scraping iFood and Pedidos Já

iFood

The iFood's search queries are made with ajax under the hood sending a POST request to this variable - _ctx+URL_SEARCH+URL_SEARCH_RESTAURANT_AND_DISH (the variable output is /search/restaurantdish).

$.ajax({
  type: "POST",
  data: {
    queryString: $("#searchField").val()
 },

Colors

Theory

Hue

Hue is the most basic of color terms and basically denotes an object’s color. When we say “blue,” “green” or “red,” we’re talking about hue. The hues you use in your designs convey important messages to your website’s visitors. Read part 1 of this article for the meanings conveyed by various hues.

Chroma

Chroma refers to the purity of a color. A hue with high chroma has no black, white or gray present in a color that has high chroma. These colors will appear very vivid and well, ... pure.

Nivelando conhecimento

Colocar coisas em produção é um saco, dependency hell.

Como se fosse um chroot com esteróides.

Tudo isso através de containers. Docker não é uma VM.

Instalando docker

@filipelinhares
filipelinhares / people.md
Last active October 4, 2016 15:45
Equipe OSA
  • Felipe Benites Cabral
    Empreendedor, hacker, ajudou a desenvolver diversos produtos (digitais e analógicos) de impacto social positivo.

  • Irio Musskopf
    Desenvolvedor de software por formação e matemático por hobby. Depois de ser um dos responsáveis por uma startup milionária em San Francisco, chegou à conclusão que esperar pelos outros pode demorar demais.

  • Eduardo Cuducos
    Hacker apaixonado por cultura e política. Programador por paixão. Candidato a PhD em Sociologia pela University of Essex. Construindo um mundo onde possamos ser mais autônomos.

module.exports = {
entry: './src/scripts/main.js',
output: {
path: __dirname + '/build',
publicPath: '/build',
filename: 'bundle.js'
},
module: {
loaders: [
@filipelinhares
filipelinhares / main.js
Last active September 18, 2018 03:43
jQuery SmoothScroll
// # SmoothScroll
$('[data-smooth-scroll]').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html, body').animate({
scrollTop: target.offset().top
}, 800);