Skip to content

Instantly share code, notes, and snippets.

View biniama's full-sized avatar

Biniam biniama

View GitHub Profile
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@jconwell
jconwell / ForwarderActor.java
Last active January 1, 2016 13:49
Akka actor that takes another ActorRef as a constructor argument, and forwards all incoming messages to the one passed in. This is useful for unit tests, where you can pass in a JavaTestKit instance to the constructor and all messages passed to this actor will be forwarded to the JavaTestKit instance.
package com.turbo.akka;
import akka.actor.ActorRef;
import akka.actor.UntypedActor;
/**
* Simple actor that takes another actor and forwards all messages to it.
* Useful in unit testing for capturing and testing if a message was received.
* Simply pass in an Akka JavaTestKit probe into the constructor, and all messages
* that are sent to this actor are forwarded to the JavaTestKit probe
@scaryguy
scaryguy / change_id_column
Last active March 21, 2022 15:24
How to reset ID column of a PostgreSQL table to let auto incrementation begin from 1?
# See your sequence name inside psql console with \ds command.
ALTER SEQUENCE seq RESTART WITH 1;
# Update sequence
UPDATE table_name SET id=nextval('seq');
@quiver
quiver / new_task.py
Created October 6, 2012 12:15
rabbitmq : dead letter exchange example with python/pika
#!/usr/bin/env python
# http://www.rabbitmq.com/tutorials/tutorial-two-python.html
import pika
import sys
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
message = ' '.join(sys.argv[1:]) or "Hello World!"
@Isammoc
Isammoc / .travis.yml
Created July 12, 2012 22:29 — forked from berngp/.travis.yml
Grails Travis YML file
language: java
jdk:
- openjdk7
- oraclejdk7
before_install:
- sudo add-apt-repository -y ppa:groovy-dev/grails
- sudo apt-get update
- sudo apt-get -y install grails-ppa # not sure if necessary
@schacon
schacon / gist:942899
Created April 26, 2011 19:19
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete