Skip to content

Instantly share code, notes, and snippets.


Rafael Bertelli zfael

View GitHub Profile
alexislucena /
Created Nov 14, 2016
Git: How to uncommit my last commit in git

To keep the changes from the commit you want to undo

$ git reset --soft HEAD^

To destroy the changes from the commit you want to undo

$ git reset --hard HEAD^

You can also say

robsonke /
Last active Nov 23, 2022
This Bash script will loop through all running docker containers on a host and list the disk usage per mount. In case it's breaching the 65%, it will email you.
# get all running docker container names
containers=$(sudo docker ps | awk '{if(NR>1) print $NF}')
# loop through all containers
for container in $containers
echo "Container: $container"
PurpleBooth /
Last active Nov 26, 2022
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches)
var pattern = /pattern/attributes; # same as above
[...]: Any one character between the brackets.
[^...]: Any one character not between the brackets.
digitaljhelms / gist:4287848
Last active Nov 22, 2022
Git/GitHub branching standards & conventions
View gist:4287848


Quick Legend

Description, Instructions, Notes
Instance Branch
rantav /
Created Aug 23, 2012
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...