Skip to content

Instantly share code, notes, and snippets.

Avatar

Rafael Bertelli zfael

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

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
robsonke / checkDockerDisks.sh
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.
View checkDockerDisks.sh
#!/bin/bash
# get all running docker container names
containers=$(sudo docker ps | awk '{if(NR>1) print $NF}')
host=$(hostname)
# loop through all containers
for container in $containers
do
echo "Container: $container"
@PurpleBooth
PurpleBooth / README-Template.md
Last active Nov 26, 2022
A template to make good README.md
View README-Template.md

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.

Prerequisites

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

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@rantav
rantav / README.md
Created Aug 23, 2012
Find slow queries in mongo DB
View README.md

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...