display: block;
width: 100%;
This file contains hidden or 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
/* | |
The HTML structure should be something like this: | |
<div class="box"> | |
<div class="box__content"> | |
// Images or whatever inside | |
</div> | |
</div> |
This file contains hidden or 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
$some-variable = 10px | |
body | |
width: "calc(100% - %s)" % $some-variable | |
// To use multiple variables wrap the values into round brackets. | |
$some-variable = 10px | |
$another-variable = 5px |
This file contains hidden or 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
var attempts; | |
function doAjaxRequest() { | |
attempts = 0; | |
doAjaxRequestLoop(); | |
} | |
function doAjaxRequestLoop() { | |
attempts += 1; | |
if (attempts > 10) { | |
alert('too many attempts.'); |
This file contains hidden or 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
ssh-keygen -R "you server hostname or ip" |
This file contains hidden or 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
// Credits https://medium.com/@danilosapad/how-to-recursively-remove-ds-store-files-on-mac-os-x-6c8570c68ad0 | |
* Open Terminal. | |
* Go to desired folder. | |
* Type `find . -name *.DS_Store -type f -delete`. |
This file contains hidden or 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
date="$(echo "20180228T125033" | cut --output-delimiter=$'-' -c1-4,5-6,7-8)" | |
time="$(echo "20180228T125033" | cut --output-delimiter=$'-' -c10-11,12-13,14-15)" | |
date --utc --date "$date $time" +%s |
This file contains hidden or 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
xmlstarlet ed -L -d "/path/to/tag[contains(text(),'some text')]" "path/to/file" |
- Open the Terminal and enter
open ~/.bash_profile
- At the end of the file, paste the code below:
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
You must have brew
installed
- Open the Terminal and enter
brew install bash-completion
. - Now enter
open ~/.bash_profile
. - At the end of the file paste the code below:
# Bash completion
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
OlderNewer