Similar to google images preview.
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
# Define the slugify function. | |
slugify () { | |
# Convert the string into a slug and assign it to a variable. | |
slug="$(echo "$1" | iconv -t ascii//TRANSLIT | sed -r s/[~\^]+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z)" | |
# Copy the passed variable to system clipboard. | |
echo "$slug" | pbcopy | |
# Show user the slug and status. | |
echo "$slug was copied to your clipboard." |
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
$ ag "class(list\.(add|remove|toggle)\(|(name)?\s*[:=])\s*['\"]([^'\"]+\s)?(field|is-focused|is-disabled|is-read-only|is-success|is-warning|is-error|table-lightth|table-lighttd|btn|btn-primary|btn-outline|h1|h2|h3|h4|h5|h6|bold|regular|italic|caps|left-align|center|right-align|justify|nowrap|break-word|truncate|list-reset|inline|block|inline-block|table|table-cell|overflow-hidden|overflow-scroll|overflow-auto|left|right|fit|border-box|align-baseline|align-top|align-middle|align-bottom|m0|mt0|mr0|mb0|ml0|m1|mt1|mr1|mb1|ml1|m2|mt2|mr2|mb2|ml2|m3|mt3|mr3|mb3|ml3|m4|mt4|mr4|mb4|ml4|mxn1|mxn2|mxn3|mxn4|mx-auto|p0|p1|py1|px1|p2|py2|px2|p3|py3|px3|p4|py4|px4|relative|absolute|fixed|top-0|right-0|bottom-0|left-0|z1|z2|z3|z4|sm-show|md-show|lg-show|sm-hide|md-hide|lg-hide|display-none|hide|container|col|col-right|col-1|col-2|col-3|col-4|col-5|col-6|col-7|col-8|col-9|col-10|col-11|col-12|sm-col|sm-col-right|sm-col-1|sm-col-2|sm-col-3|sm-col-4|sm-col-5|sm-col-6|sm-col-7|sm-col-8|sm-col-9|sm-col-10|sm-col-11|sm-col-12|md |
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
<body> | |
<div class="container"> | |
<h1>Pace Calculator</h1> | |
<h2>JS Foundations - Assignment 3</h2> | |
<div class="form-inline"> | |
<div class="form-group"> | |
<label for="distance">Distance</label> | |
<input type="text" id="distance" class="form-control" placeholder="miles"/> | |
</div> | |
<div class="form-group"> |
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
<table> | |
<tbody id="grid"></tbody> | |
</table> |
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
function fizzbuzzer(max) { | |
function check(n) { | |
var msg = ''; | |
if ( n % 3 == 0 ) { msg += "Fizz" }; | |
if ( n % 5 == 0 ) { msg += "Buzz" }; | |
//console.log('inside: '+ msg); | |
return msg || n; | |
} | |
//console.log('outside for loop: '+ msg); /* Behavior of vars in closures - they are inaccessible after the function runs.*/ |
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
<header class="text-center"> | |
<h1>JavaScript Tic-Tac-Toe</h1> | |
<h2 class="message">Click a square to mark your spot!</h2> | |
<button id="reset" class="btn btn-primary">Reset</button> | |
</header> | |
<div> | |
<ul id="grid"></ul> | |
</div> |