Skip to content

Instantly share code, notes, and snippets.

@Integralist
Integralist / git reset explained.md
Last active March 14, 2022 10:25
git reset --soft/--mixed/--hard

UPDATE

Every time I accidentally git commit --amend instead of a normal git commit I have to google git reset --soft HEAD@{1} to save the day.


Imagine you have a file called foo.txt and your Git history looked like this:

A -> B -> C (HEAD)
@andycole
andycole / pre-commit
Created February 11, 2014 17:33
Pre commit hook to check for common debugs (belongs in ./git/hooks)
#!/usr/local/bin/bash
# Add or remove keywords here
KEYWORDS_REGEX="var_dump\(|die\(|Zend_Debug::|print_r\(|console\.(debug|info|log|warn)\("
# Add extensions to check here
EXTENSIONS_REGEX="(.php$|.phtml$|.js$|.html$)"
ERRORS_BUFFER=""
TEXT_DEFAULT="\\033[0;39m"
TEXT_INFO="\\033[1;32m"
TEXT_ERROR="\\033[1;31m"
@Integralist
Integralist / 2013-review.md
Last active December 31, 2015 23:08
2013 review: looking back at what I achieved this year...
  • I joined BBC News (thanks @tmaslen for seeing it through my embarrassingly bad Skype interview test)
  • Learnt lots from the team at BBC (specifically @danscotton) about object-oriented design
  • Helped introduce Node/Grunt as build tools
  • Shifted the team off of QUnit and onto Jasmine (as an intermediary step towards something better)
  • Attended the NET Magazine awards as Mrs Cleveley
  • Worked on a new pattern library
  • Joined the W3C Responsive Images group and also am now part of BBC GEL.
  • Did a lot of refactoring/simplifying of over-engineered code
  • Got the chance to write a lot more Ruby and experiment more with Node (and things like PhantomJS)
  • Co-Authored the BBC News new photo gallery
source ~/.git-completion.sh
alias gco='git co'
alias gci='git ci'
alias grb='git rb'