Skip to content

Instantly share code, notes, and snippets.

View evangilo's full-sized avatar

evangilo evangilo

  • Rio Grande do Norte
View GitHub Profile
@evangilo
evangilo / strip_commits.sh
Created September 21, 2019 18:50
strip git commits
#!/bin/bash
# example: strip_commits.sh "commit_hash1 commit_hash2 ..."
export HASHS=$1
git filter-branch -f --commit-filter '
if [[ $HASHS == *"$GIT_COMMIT"* ]];
then
skip_commit "$@";
apt-get update
apt-get install wget build-essential libffi-dev zlib1g-dev libncursesw5-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev libbz2-dev -y
cd /
wget --no-check-certificate https://www.openssl.org/source/openssl-1.1.0j.tar.gz
tar xf openssl-1.1.0j.tar.gz
cd openssl-1.1.0j
@evangilo
evangilo / gist:f39acfffbe7ee532f6bf972cd98b889d
Created March 29, 2018 12:59
Install Vim 8 with Python, Python 3, Ruby and Lua support on Ubuntu 16.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~
@evangilo
evangilo / mac-vendor.txt
Created July 20, 2017 19:11 — forked from aallan/mac-vendor.txt
List of MAC addresses with vendors identities
000000 Officially Xerox
000001 SuperLAN-2U
000002 BBN (was internal usage only, no longer used)
000003 XEROX CORPORATION
000004 XEROX CORPORATION
000005 XEROX CORPORATION
000006 XEROX CORPORATION
000007 XEROX CORPORATION
000008 XEROX CORPORATION
000009 powerpipes?
from sqlalchemy import create_engine, Column, ForeignKey, Table, types
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker, relationship, backref
engine = create_engine("postgresql://<user>:<password>@localhost:5432/test", echo=False)
Base = declarative_base()
session = scoped_session(sessionmaker(bind=engine))
@evangilo
evangilo / gist:68b5b0c345ff9d6db8fe
Created February 21, 2016 21:30
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
/*
* Copyright (C) 2014 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@evangilo
evangilo / my-theme
Created August 19, 2014 19:27
meu tema para o oh-my-zsh
# adicionar a variável de ambiente no .zshrc
# export VIRTUAL_ENV_DISABLE_PROMPT=yes
function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
}
local git_branch='$(git_prompt_info)%{$reset_color%}'
local user_host='%{$terminfo[bold]$fg[green]%}%n'
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
@evangilo
evangilo / Deque.java
Last active August 29, 2015 14:04
Estrutura de dados: implementação de um deque usando lista circular duplamente encadeiada
public class Deque<T> {
private No<T> head;
public Deque() {
this.head = new No<>();
head.prox = head;
head.ant = head;
}
//autor: evangilo
const int buttonPin = 1;
const int greenLedPin = 13;
const int yellowLedPin = 12;
const int redLedPin = 11;
const int redLedPedestrianPin = 10;