Skip to content

Instantly share code, notes, and snippets.


Renan Borges renanborgez

Block or report user

Report or block renanborgez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View clear-local-branches.txt
## Delete local branches already merged
git fetch --prune && git branch --merged | egrep -v "(^\*|master|develop)" | xargs git branch -d
## Delete local branches
git fetch --prune && git branch | egrep -v "(^\*|master|develop)" | xargs git branch -d
markerikson / redux-saga-poll-loop.js
Last active Nov 29, 2019
Redux-Saga controllable long-polling loop
View redux-saga-poll-loop.js
import { take, put, call, fork, cancel, cancelled } from 'redux-saga/effects'
import {EVENT_POLLING_START, EVENT_POLLING_STOP} from "constants/eventPolls";
import {ClientEventType} from "constants/serverEvents";
function* handleEventA(serverEvent) {
yield put({type : serverEvent.type, payload : {name : serverEvent.eventAData}});
JeffBelback /
Last active Jan 9, 2020
Destroy all Docker Containers and Images
# Stop all containers
containers=`docker ps -a -q`
if [ -n "$containers" ] ; then
docker stop $containers
# Delete all containers
containers=`docker ps -a -q`
if [ -n "$containers" ]; then
docker rm -f -v $containers
jbgo /
Last active Jan 23, 2020
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
You can’t perform that action at this time.