Skip to content

Instantly share code, notes, and snippets.

View luizcarraro's full-sized avatar
🏠
Working from home

Luiz Carraro luizcarraro

🏠
Working from home
  • Pato Branco - BR
View GitHub Profile
@luizcarraro
luizcarraro / .gitconfig
Last active October 31, 2024 21:41
Ultimate .gitconfig Collection
# This is Git's per-user configuration file.
[user]
name = Luiz Carraro
email = [email protected]
[push]
default = matching
[alias]
#MISC
plog = log --pretty=tformat:'%h\t%cr\t%cn\t\t%s'
plogcolor = log --pretty=tformat:'%C(bold blue)%h%Creset\t%Cblue%cr%Creset\t%cn\t\t%Cgreen%s%Creset'
@luizcarraro
luizcarraro / elb-nodejs-ws.md
Created January 9, 2018 15:31 — forked from obolton/elb-nodejs-ws.md
Configuring an AWS Elastic Load Balancer for a Node.js application using WebSockets on EC2

AWS ELB with Node.js and WebSockets

This assumes that:

  • You are using Nginx.
  • You want to accept incoming connections on port 80.
  • Your Node.js app is listening on port 3000.
  • You want to be able to connect to your Node.js instance directly as well as via the load balancer.

####1. Create load balancer

@luizcarraro
luizcarraro / domain.com.br.conf
Created December 11, 2017 19:16
Configurar query param inserido pelo NGINX dinamicamente
location = /oneapi {
set $args $args&parametro=johnDoe;
proxy_pass https://api.somewhere.com;
}
@luizcarraro
luizcarraro / Arvore.c
Created October 2, 2017 11:37
Arvore Binária do Brunão (Com suporte a Linux 64bits)
#include <stdio.h>
#include <stdlib.h>
typedef struct nodo{
int valor;
struct nodo *esquerda, *direita;
}Nodo;
Nodo *arvore;
@luizcarraro
luizcarraro / electron_context_menu.js
Created September 25, 2017 12:40
[ELECTRON] Menu-contexto com opções de copiar, colar e cortar em inputs e divs
(function () {
'use strict';
const remote = require('electron').remote;
const Menu = remote.Menu;
const MenuItem = remote.MenuItem;
const isAnyTextSelected = function () {
return window.getSelection().toString() !== '';
};
@luizcarraro
luizcarraro / capture-links.js
Created September 22, 2017 12:48
Ember Helper para Capturar links e os torna clicáveis
@luizcarraro
luizcarraro / open-external-link.js
Created July 27, 2017 11:37
ELECTRON: Open link in external default OS browser
// Trocar body pela Div
body:before {
-webkit-animation: 10s normal forwards zoomin ease-in;
animation: 10s normal forwards zoomin ease-in;
background-image: url("http://www.artisanaljavascript.com/images/tradition.jpg");
background-size: cover;
content: " ";
height: 100%;
position: fixed;
-webkit-transform-origin: center center 0;
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
classificacao: {
pessoa: {
tipo: 'FISICA'
}
}
});
@luizcarraro
luizcarraro / badRequest.js
Created June 19, 2017 17:48
Custom sails badrequest response for ember processing
/**
* 400 (Bad Request) Handler
*
* Usage:
* return res.badRequest();
* return res.badRequest(data);
* return res.badRequest(data, 'some/specific/badRequest/view');
*
* e.g.:
* ```