Skip to content

Instantly share code, notes, and snippets.

View IlkhamGaysin's full-sized avatar
🏠
Working from home

Ilkham Gaysin IlkhamGaysin

🏠
Working from home
View GitHub Profile
@IlkhamGaysin
IlkhamGaysin / gist:85b179e09fba41f7b40954376daa99f1
Created June 4, 2016 13:31 — forked from stuart11n/gist:9628955
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
@IlkhamGaysin
IlkhamGaysin / remove_all_gems_from_gemfile.md
Created June 3, 2016 20:51
allow remove all gems one by one

for i in `gem list --no-versions`; do gem uninstall -aIx $i; done

require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
context "GET index" do
#context "POST create" do
#context "GET show" do
#context "PATCH update" do (or PUT update)
#context "DELETE destroy" do
#context "GET new" do
@IlkhamGaysin
IlkhamGaysin / postgres_in_another_pid.md
Last active March 2, 2017 06:32
postgres check running in another pid

OSX Mavericks has been crashing randomly recent to me. Just very random. Not quite good because it doesn't give it the chance for processes like Postgres, etc... to shut down properly, leaving process ids (PIDs) behind.

Now got this issue where my postgres won't boot up.

Running postgres manually doesn't work

> pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
> pg_ctl: another server might be running; trying to start server anyway
So here's a quick fix.