Skip to content

Instantly share code, notes, and snippets.

@avelino
avelino / gist:3188137
Created July 27, 2012 13:49
shell script, como colorir o retorno do seu código
echo -e " \033[0;30m Preto \033[0m --> 0;30 "
echo -e " \033[0;31m Vermelho \033[0m --> 0;31 "
echo -e " \033[0;32m Verde \033[0m --> 0;32 "
echo -e " \033[0;33m Marrom \033[0m --> 0;33 "
echo -e " \033[0;34m Azul \033[0m --> 0;34 "
echo -e " \033[0;35m Purple \033[0m --> 0;35 "
echo -e " \033[0;36m Cyan \033[0m --> 0;36 "
echo -e " \033[0;37m Cinza Claro \033[0m --> 0;37 "
echo -e " \033[1;30m Preto Acinzentado \033[0m --> 1;30 "
echo -e " \033[1;31m Vermelho Claro \033[0m --> 1;31 "
Individual Contributor License Agreement ("Agreement"), v1.0
Thank you for your interest in contributing to open-source software projects (“Projects”) made available by cljazz, Inc., or its affiliates (cljazz). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to cljazz in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact hey@cljazz.co.
You accept and agree to the following terms and conditions for Your past, present, and future Contributions submitted to cljazz, Inc. ("cljazz"). Except for the license granted herein to cljazz and recipients of software distributed by cljazz, You reserve all right, title, and interest in and to Your Contributions.
Definitio
@avelino
avelino / GzipStream.go
Last active April 6, 2023 11:13
golang gzip stream
func GetGzip(path string) string {
println(path)
client := &http.Client{
Transport: &transport.Transport{
ReadTimeout: 10 * time.Second,
RequestTimeout: 15 * time.Second,
},
}
#!/usr/bin/env python
import requests
import base64
proxies = {
'http': 'http://avelino:PASS@us-wa.proxymesh.com:31280',
'https': 'http://avelino:PASS@us-wa.proxymesh.com:31280'
}
@avelino
avelino / gist:3188205
Created July 27, 2012 14:05
Como deixar o retorno do Node.js colorido
'use strict';
//// http://avelino.us/2012/07/27/console-colorido-usando-node-js
////
// Retorna o texto em vermelho
console.log("\033[31m Aqui esta o texto em vermelho.")
// Retorna o texto em azul
console.log("\033[34m Aqui esta o texto em azul.")
@avelino
avelino / JGitUtil.java
Created December 20, 2019 01:24 — forked from porcelli/JGitUtil.java
jgit on bare repo
public static void delete(final Git git, final String branchName, final String path,
final String name, final String email, final String message, final TimeZone timeZone, final Date when) {
commit(git, branchName, path, null, name, email, message, timeZone, when);
}
public static void commit(final Git git, final String branchName, final String path, final File file,
final String name, final String email, final String message, final TimeZone timeZone, final Date when) {
final String gitPath = fixPath(path);
from datetime import datetime
github_date = datetime.strptime(input_data['github_date_str'], '%Y-%m-%dT%H:%M:%SZ')
weeknumber = int(github_date.strftime("%w"))
task_date = 'tuesday'
if weeknumber >= 4 and weeknumber <= 5:
task_date = 'thursday'
return {'task_date': task_date}
[server]
freenode.addresses = "chat.freenode.net/6667"
freenode.password = ""
freenode.autojoin = "#bottlepy,#django-br,#django-dev,#grupy-sp,#openmining,#opps,#python-br,#python,#tsuru,#awesome-go,#go-nuts"
info: Hooks handler stderr: Traceback (most recent call last):
File "/Users/avelino/.virtualenvs/dredd/bin/dredd-hooks-python", line 13, in <module>
info: Hooks handler stderr: dredd.main(sys.argv[1:])
File "/Users/avelino/.virtualenvs/dredd/lib/python2.7/site-packages/dredd_hooks/dredd.py", line 246, in main
load_hook_files(a)
File "/Users/avelino/.virtualenvs/dredd/lib/python2.7/site-packages/dredd_hooks/dredd.py", line 142, in load_hook_files
info: Hooks handler stderr: module = imp.load_source(os.path.basename(path), real_path)
File "/Users/avelino/src/github.com/nuveo/publicapi/hooks.py", line 60
λ ~/test/ tree
.
├── adapters
│   ├── adapters.go
│   ├── mongodb
│   │   └── mongodb.go
│   └── postgres
│   └── postgres.go
├── helpers
│   └── herlpers.go