Skip to content

Instantly share code, notes, and snippets.

View zfael's full-sized avatar

Rafael Bertelli zfael

View GitHub Profile
alexislucena /
Created November 14, 2016 08:56
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 February 18, 2024 12:44
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 April 18, 2024 00:56
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 April 17, 2024 23:04
Git/GitHub branching standards & conventions


Quick Legend

Description, Instructions, Notes
Instance Branch
rantav /
Created August 23, 2012 06:13
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...