This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name '*.txt' -print0 | xargs -0 sed -i "" "s/this/that/g" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check out the branch you wish to merge to. Usually, you will merge into master. | |
git checkout master | |
// Pull the desired branch from the upstream repository. This method will retain the commit history without modification. | |
git pull https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git BRANCH_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git push origin :refs/tags/1.0.0 | |
git tag -f "1.0.0" | |
git push origin master --tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Force the repaint of an element. Sometimes necessary when adding CSS rules after document loaded. | |
function forceRepaint(element) { | |
element.style.display='none'; | |
var temp = element.offsetHeight; | |
element.style.display=''; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hasVerticalScroll() { | |
var scrollHeight = document.body.scrollHeight; | |
var clientHeight = document.documentElement.clientHeight; | |
var hasVerticalScrollbar = scrollHeight > clientHeight; | |
return hasVerticalScrollbar; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function detectScrollbarWidth() { | |
var outer = document.createElement('div'); | |
outer.style.visibility = 'hidden'; | |
outer.style.width = '100px'; | |
outer.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps | |
document.body.appendChild(outer); | |
var widthNoScroll = outer.offsetWidth; | |
// force scrollbars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<(\w+)\b(?:\s+[\w\-.:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[\w\-.:]+))?)*\s*/?>\s*</\1\s*> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.center_absolute_positioned { | |
position: absolute; | |
margin-left: auto; | |
margin-right: auto; | |
left: 0; | |
right: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.PointerEvent ? "pointer" : "ontouchstart" in window ? "touch" : "mouse"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ setxkbmap -option apple:badmap | |
# Place that command into ~/.bashrc file to have it run automatically when you log in. |