Skip to content

Instantly share code, notes, and snippets.

View marcelosantos's full-sized avatar

Marcelo Santos marcelosantos

View GitHub Profile
@marcelosantos
marcelosantos / git-remove-all-files-from-repo.sh
Created January 16, 2017 13:00
git: recursively remove all files from a repo
Recursively remove all files of filetype .foo from the repo:
git filter-branch --tree-filter 'git rm -r -f --ignore-unmatch *.foo' HEAD
@marcelosantos
marcelosantos / upgrade-postgres-9.3-to-9.5.md
Created June 2, 2017 11:21 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
@marcelosantos
marcelosantos / mysql.txt
Created October 9, 2017 17:33 — forked from johnantoni/mysql.txt
mysql + vagrant + remote access
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
@marcelosantos
marcelosantos / configurando.webhook.autodeploy.md
Created October 18, 2017 19:20 — forked from samirfor/configurando.webhook.autodeploy.md
Configurando Webhook para Autodeploy no GitLab

Configurando Webhook para Autodeploy no GitLab

  1. Crie uma pasta no /var/www/ chamada .ssh.
 mkdir -p /var/www/.ssh
  1. Crie uma chave para o usuário www-data.
@marcelosantos
marcelosantos / Gruntfile.js
Created April 27, 2018 12:40 — forked from edderrd/Gruntfile.js
Sample laravel grunt file
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
less: {
development: {
options: {
paths: ["public/assets/less/*.less"]
}
}
},
@marcelosantos
marcelosantos / gist:de5545f67654cc90d2d1f22b3ed40d62
Created November 16, 2018 16:43 — forked from CrookedNumber/gist:8964442
git: Removing the last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.