Skip to content

Instantly share code, notes, and snippets.

@nirev
nirev / gist:f367258726baffef6ca5
Last active August 29, 2015 14:02 — forked from malclocke/gist:943565
Delete git remote branches that are merged
# deletes remote branchs that are merged
$ git branch -r --merged |
awk -F'/' '/^ *origin/{if(!match($0, /(>|master|production)/)){print $2}}' |
xargs git push origin --delete
defmodule MonadError do
defmacro __using__(_) do
quote do
import MonadError, only: [bind: 1, fail: 1, fail: 0, with: 3, either: 3, sandbox: 1]
require MonadError
end
end
defmacro sandbox(body) do

Keybase proof

I hereby claim:

  • I am nirev on github.
  • I am nirev (https://keybase.io/nirev) on keybase.
  • I have a public key ASA0iUz7lDk8COWoruwEqMtQBGdtQEux2s6TYKabVsH3gwo

To claim this, I am signing this object:

@nirev
nirev / gpg-import-and-export-instructions.md
Created February 22, 2017 14:06 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@nirev
nirev / decrypt-jenkins.py
Created February 22, 2017 21:10
Decrypt jenkins credentials.xml
#!/usr/bin/env python
import re
import sys
import base64
from hashlib import sha256
from binascii import hexlify, unhexlify
from Crypto.Cipher import AES
MAGIC = "::::MAGIC::::"
@nirev
nirev / gist:f9452070ab1f4a87012fbc4a5a05c17f
Created February 23, 2017 17:49 — forked from nilo/gist:c2a31a0f9f29c88145ca
Using cedilha - ArchLinux Cinnamon
Author: Nilo Dantas - n1lo
Based on: https://bugs.launchpad.net/ubuntu/+source/ibus/+bug/518056 - helio-valente post
How to use Cedilha on US Keyboard on ArchLinux
1) Put: English(US, internacional with dead Keys) on your system keyboard layout.
2) Editing the files:
sudo vim /usr/lib/gtk-3.0/3.0.0/immodules.cache

Teste de Programação Elo7

Como parte do processo seletivo do Elo7, gostaríamos que você fizesse uma pequena tarefa. Conforme seu resultado daremos continuidade ao processo te convidando para uma sessão de pair-programming.

Durante o desenvolvimento dê preferência para implementação em Java.

O objetivo dessa tarefa é avaliar como você vai desenvolver o código em termos de estilo, eficiência e qualidade.

@nirev
nirev / vpn-auto-reconnect.sh
Created March 13, 2017 13:26 — forked from numericOverflow/vpn-auto-reconnect.sh
Auto reconnect to OpenVPN via NetworkManager
#!/bin/bash +x
# Source: http://www.gabsoftware.com/tips/automatically-reconnect-to-your-vpn-on-linux/
# Description:
# Make the script executable "chmod +x /path/to/the/script.sh
# Put the script in .profile or .bashrc so it can be run on user login:
# Example: echo "/path/to/the/script.sh start &" >> .bashrc
# The script can be bound to shortcut keys with these commands:
# /path/to/the/script.sh start # starts and monitors VPN connection
@nirev
nirev / byobu-cheat-sheet.md
Last active October 17, 2017 15:16 — forked from inhumantsar/gist:bf86ff1961cccdf8be06
Byobu Cheat Sheet

KEYBINDINGS

byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used).

The common key bindings are:

Key Action
F2 Create a new window
@nirev
nirev / Dockerfile
Created September 30, 2019 16:30
Elixir Dockerfile based on erlang
ARG OTP_VERSION=22.0
##################################################
# Base - setup project and docker cache for build
FROM erlang:${OTP_VERSION}-alpine as base
# elixir expects utf8.
ENV ELIXIR_VERSION="v1.9.1" \
LANG=C.UTF-8