Skip to content

Instantly share code, notes, and snippets.

View cosmincatalin's full-sized avatar
👻

Cosmin Catalin SANDA cosmincatalin

👻
View GitHub Profile
@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@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
@fedir
fedir / checkUrlExists.m1.py
Last active May 25, 2022 14:56
Check if URL exists via Python
from urllib2 import urlopen
code = urlopen("http://example.com/").code
if (code / 100 >= 4):
print "Nothing there."
# via http://stackoverflow.com/questions/1966086/how-can-i-determine-if-anything-at-the-given-url-does-exist
@colorful-tones
colorful-tones / ClearDNSCache
Created June 11, 2013 14:40
clear dns cache on mac via Terminal or iTerm
sudo killall -HUP mDNSResponder
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@czarneckid
czarneckid / gist:1536207
Created December 29, 2011 21:08
Installing older or specific versions of Homebrew formulas

We first want to take a look at what versions are installed for a given formula, brew info FORMULA. Let's take a look at the versions of Redis that are installed.

@czq. ➜  Formula rvm:() git:(master) brew info redis
redis 2.4.5
http://redis.io/
/usr/local/Cellar/redis/2.4.4 (9 files, 460K)
/usr/local/Cellar/redis/2.4.5 (9 files, 460K) *
...