Skip to content

Instantly share code, notes, and snippets.

View barlas's full-sized avatar

Barlas Apaydin barlas

View GitHub Profile
@barlas
barlas / NewMacConfig.md
Last active August 29, 2015 14:27 — forked from offsky/NewMacConfig.md
Setup new mac for web development (Updated for Yosemite)
git add .
git commit -m "message"
git show --pretty="format:" --name-only
git push
delete: git rm -r filename
- Create a repository
git init <repo-name>
git clone <url> <directory-name>
@barlas
barlas / ready-hash-history.js
Last active August 29, 2015 14:10 — forked from sstephenson/back_forward.js
javascript - Detecting hash change from browser's back and foward buttons.
var detectBackOrForward = function(onBack, onForward) {
hashHistory = [window.location.hash];
historyLength = window.history.length;
return function() {
var hash = window.location.hash, length = window.history.length;
if (hashHistory.length && historyLength == length) {
if (hashHistory[hashHistory.length - 2] == hash) {
hashHistory = hashHistory.slice(0, -1);
onBack();