Skip to content

Instantly share code, notes, and snippets.

View eliocapelati's full-sized avatar
👋
Hello world!

Elio eliocapelati

👋
Hello world!
View GitHub Profile
@eliocapelati
eliocapelati / sites_evitar_procon.json
Last active August 29, 2015 14:10
Lista de sites para evitar na Black Friday Brasileira, essa lista atualizada pode ser encontrada originalmente e atualizada no site: http://sistemas.procon.sp.gov.br/evitesite/list/evitesites.php
{
"ListaDeSitesParaEvitar": {
"site": [
{
"documento": null,
"inclusao": "01/09/2014",
"nome": "adorocompraronline.com",
"status": "NO AR",
"url": "adorocompraronline.com"
},
@eliocapelati
eliocapelati / app.log
Created December 17, 2014 13:07
Amazon Linux 64bit, Java 8, Tomcat8, Spring 3.2.2
2014-12-17 12:41:12,470 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.internalAsyncAnnotationProcessor': Cannot resolve reference to bean 'taskExecutor' while setting bean property 'executor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'taskExecutor': Invocation of init method failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy' to required type 'edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionHandler' for property 'rejectedExecutionHandler'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy] to required type [edu.emory.mathcs.backport.java.util.c
@eliocapelati
eliocapelati / App.java
Created March 24, 2015 18:13
Java way to get a truly immutable copy of a List.
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
class App{
public static void main(String[] args) throws Exception {
List<String> list = Arrays.asList("a", "b", "c");
List<String> local = new ArrayList<String>(list);
@eliocapelati
eliocapelati / maven-output-jdk_1.7.0_40
Created July 16, 2015 03:00
Using Immutables with Java 7~8
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building POC-Immutables 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ POC-Immutables ---
[INFO] Deleting /Users/eliocapelati/dev/gabbay/ws/POC-Immutables/target
@eliocapelati
eliocapelati / table_w_elements.adoc
Last active August 29, 2015 14:26
Use asciidoctor-pdf to reproduce the problem...

Testing table with attributes

Test table with default Asciidoc atributes

Table 1. Table with some elements
@eliocapelati
eliocapelati / osx-for-hackers.sh
Last active August 27, 2015 13:39 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
#!/usr/bin/env bash
CONVERSION="USDBRL"
#Yahoo YQL console: https://developer.yahoo.com/yql/console/
PARAM1="q=select * from yahoo.finance.xchange where pair in (%22$CONVERSION%22)&env=store://datatables.org/alltableswithkeys"
FORMAT="json" #XML store about 405b | JSON store about 202b
PARAM2="format=$FORMAT"
URL="http://query.yahooapis.com/v1/public/yql"
SAVEPATH="~/currencies/"
INTERVAL=1
[
{ "keys": ["ctrl+alt+i"], "command": "show_overlay", "args": {"overlay": "command_palette", "text": "Package Control: Install Package"} },
{ "keys": ["shift+alt+d"], "command": "set_setting", "args": {"setting": "draw_white_space","value": "all"} },
{ "keys": ["shift+alt+a"], "command": "set_setting", "args": { "setting": "draw_white_space", "value": "selection" }},
]
#!/usr/bin/env bash
BOLD="\033[1m"
RED="\033[31m"
N_C="\033[0m"
usage(){
echo -e "\n\n"
echo -e "Usage:\n"
@eliocapelati
eliocapelati / check_restart_cntlm.sh
Last active December 22, 2015 21:19
Check if the remote proxy is down, and restart your connection.
#!/usr/bin/env bash
log(){
#See "$ man logger"
logger -i -t "CR-CNTLM" "[User:$(whoami)] $1"
}
##TODO: Impl system count of unsuccessful restarts (Redis?)
##MUST BE ROOT