Skip to content

Instantly share code, notes, and snippets.

View wandersoncferreira's full-sized avatar
🐢

bartuka wandersoncferreira

🐢
View GitHub Profile
@wandersoncferreira
wandersoncferreira / sbt_create_proj.sh
Created September 23, 2017 12:07
Create SBT folder structure
#!/bin/bash
proj=$1
mkdir $proj
cd $proj
mkdir -p src/{main,test}/{java,resources,scala}
mkdir lib project target
# create an initial build.sbt file
echo "name := \"$proj\"
@wandersoncferreira
wandersoncferreira / install_scala.sh
Created September 23, 2017 12:11
Installing SBT and Scala in Ubuntu 16.04
## Java
sudo apt-get update
sudo apt-get install default-jdk
## Scala
sudo apt-get remove scala-library scala
sudo wget http://scala-lang.org/files/archive/scala-2.12.1.deb
sudo dpkg -i scala-2.12.1.deb
sudo apt-get update
sudo apt-get install scala
@wandersoncferreira
wandersoncferreira / gmail-notmuch.py
Last active October 9, 2017 12:11
Python file to download gmails to notmuch
#!/usr/bin/python
# (C) Copyright 2012 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
# We need to use Python 2.7 in order to make this work! - Bartuka
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@wandersoncferreira
wandersoncferreira / goSetup.sh
Created December 31, 2017 13:22
Setup GO to have a better Emacs experience
#!/usr/bin/env bash
echo 'install go complete daemon'
go get -u github.com/nsf/gocode
echo 'install go definitions'
go get -u github.com/rogpeppe/godef/...
echo 'install go imports'
go get -u golang.org/x/tools/cmd/goimports
@wandersoncferreira
wandersoncferreira / ec.sh
Created January 9, 2018 02:59
Script to launch the Emacs in daemon mode
#!/bin/bash
# This script starts emacs daemon if it is not running, opens whatever file
# you pass in and changes the focus to emacs. Without any arguments, it just
# opens the current buffer or *scratch* if nothing else is open. The following
# example will open ~/.bashrc
# ec ~/.bashrc
# You can also pass it multiple files, it will open them all. Unbury-buffer
@wandersoncferreira
wandersoncferreira / et.sh
Created January 9, 2018 02:59
Script to open Emacs in Terminal mode using the same daemon server
#!/bin/bash
# Makes sure emacs daemon is running and opens the file in Emacs in
# the terminal.
# If you want to execute elisp, use -e whatever, like so
# et -e "(message \"Word up\")"
# You may want to redirect that to /dev/null if you don't want the
@wandersoncferreira
wandersoncferreira / es.sh
Created January 9, 2018 03:03
Script to stop Emacs daemon
#!/bin/bash
# simple script to shutdown the running Emacs daemon
# emacsclient options for reference
# -a Alternate editor, runs bin/false in this case
# -e eval the script
# If the server-process is bound and the server is in a good state, then kill
# the server
@wandersoncferreira
wandersoncferreira / .circle.yml
Created July 17, 2019 17:35 — forked from lukaszkorecki/.circle.yml
How to setup code coverage for Clojure + Cloverage + CircleCI + CodeClimate
version: 2
jobs:
build:
docker:
- image: circleci/clojure:lein-2.7.1
environment:
- CC_TEST_REPORTER_ID=....set in project settings....
steps:
@wandersoncferreira
wandersoncferreira / test.check-interest-rate.clj
Created January 5, 2020 00:05
Demonstration of how test.check works. Generative testing in Clojure
(ns secland.compount-interest-test
(:require [clojure.spec.alpha :as s]
[clojure.test.check.clojure-test :refer [defspec]]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[secland.finances.compound-interest :as comp-interest]))
(defn- define-rate-range [min max]
(gen/fmap #(BigDecimal. (/ % 1000.)) (gen/large-integer* {:min min :max max})))
@wandersoncferreira
wandersoncferreira / gerar_cnpj_cpf.lua
Created February 8, 2020 12:34
Código para gerar CPF e CNPJ válidos em Lua
function digito_verificador(random_cnpj, pesos)
local table_check = {}
for i, p in ipairs(pesos) do
table_check[i] = random_cnpj[i] * p
end
local sum_check = 0
for i, p in ipairs(table_check) do
sum_check = sum_check + p
end