Skip to content

Instantly share code, notes, and snippets.

@chadwick37
chadwick37 / gist:7233409
Created October 30, 2013 14:16
Force git to overwrite local changes on git pull
git fetch --all
git reset --hard origin/master
@chadwick37
chadwick37 / Jquery auto-resize images
Created April 6, 2013 13:02
Resize any images posted by users that are above a certain threshold while preserving the aspect ration.
<style type="text/css">
div.resized_image p {
margin: 2px;
margin-top: 0;
font-size: 8px;
/* Awesome icon from here: http://www.famfamfam.com/lab/icons/silk/ */
background: url(http://i242.photobucket.com/albums/ff244/9861_omikron/error.png) no-repeat;
padding-left: 20px;
color: #333;
}
@chadwick37
chadwick37 / Clone a repo to a folder
Created March 25, 2013 12:42
Clone a repo to a specific folder (this is done in terminal on the remote hosting server).
git clone git@github.com:{repo_name}.git {folder}
@chadwick37
chadwick37 / Clone a branch
Created March 25, 2013 12:40
Clone a specific branch on a github repo
git clone -b {branch} git@github.com:{repo_name}.git
@chadwick37
chadwick37 / Keygen for github
Created March 25, 2013 12:35
Create an ssh key on a server in order to connect the server to your github account. Necessary for updating code from private repos. Once the key is created go to the github repo, click settings, then deploy keys, and add the key. On GitHub, you need to add this key, the exact content of id_rsa.pub.
ssh-keygen -t rsa