Skip to content

Instantly share code, notes, and snippets.

@cv
cv / bad.go
Created Feb 12, 2020
shorten scope of intermediate variables
View bad.go
func (a *b) C(ctx context.Context) (*d, error) {
thingWithLongName, err := a.someService.Get(ctx, servicepkg.GetInput{
// …
})
if err == servicepkg.NotFound {
return &d{}, nil
}
if err != nil {
return nil, err
}
View pr-queue.rb
#!/usr/bin/env ruby
require "bundler/inline"
ORG=(ARGV.length == 1 && ARGV[0]) or raise "Usage: pr-queue.rb <org-name>"
gemfile do
source "https://rubygems.org"
gem "octokit"
gem "pry"
View keybase.md

Keybase proof

I hereby claim:

  • I am cv on github.
  • I am cvillela (https://keybase.io/cvillela) on keybase.
  • I have a public key ASAr-oB0XnKMqnPRmVemZAF9M8TDyAvRi7qKFphjLm4whgo

To claim this, I am signing this object:

View .spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration .
You should not put any user code in this function besides modifying the variable
values . "
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@cv
cv / leela.txt
Created Apr 14, 2015
My cat's first commit
View leela.txt
33333333333333eeeeee```wrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrryyy22222222fffffffff5u5555555555555uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuUUUU$$$$$$1111111ssssssssssssssssffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddfffffffffffffffaaaaaaaaaaaaaaaaafffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 99999999999999999999999999999999999999999999999999999989888897777777777777777777777773333333333333333bbbbbbb9~9~9~9~dddddddddddddddddddddddddddddddddddddddqqqqqqqqqqqqqqq4444444444444aaa11111111111111111111111111111111111111111111111111111111111111111111111raaaaaaaaa444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
@cv
cv / auxílio-doença.xml
Created Feb 17, 2015
Exemplo de XML de serviço (legado)
View auxílio-doença.xml
<?xml version="1.0" encoding="UTF-8"?>
<servico>
<titulo>Auxílio-Doença</titulo>
<descricao>Benefício concedido ao segurado impedido de trabalhar por doença ou acidente por mais de 15 dias
consecutivos. No caso dos trabalhadores com carteira assinada, os primeiros 15 dias são pagos pelo empregador,
exceto o doméstico, e a Previdência Social paga a partir do 16º dia de afastamento do trabalho. Para os demais
segurados inclusive o doméstico, a Previdência paga o auxílio desde o início da incapacidade e enquanto a mesma
perdurar.
</descricao>
<requisitos></requisitos>
@cv
cv / array-listeners.js
Created Jan 12, 2015
array-listeners.js
View array-listeners.js
Array.prototype.addEventListener = function(fn, cb) {
if(!this.__eventListeners) {
this.__eventListeners = {};
}
if(typeof(fn) !== 'string') {
throw "Can't add event listener: 1st argument is not a string";
}
if(typeof(cb) !== 'function') {
@cv
cv / robot.js
Created Dec 5, 2012 — forked from fabiopimentel/robot.js
[CAELUM TEAM]Megatron
View robot.js
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.clone();
View gist:4016135
git config --global github.password 'security find-internet-password -wgs github.com # 2>&1 >/dev/null find-internet-password -wgs github.com'