- EditorConfig for VS Code
- ESLint
- Prettier - Code formatter
- Python
- stylelint
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 binarySearch(list, item) { | |
var low = 0; | |
var high = list.length - 1; | |
while (low <= high) { | |
var mid = low + Math.floor((low + high) / 2); | |
var guess = list[mid]; | |
if (guess === item) { | |
return mid; |
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
RewriteEngine On | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://steverydz.com/$1 [R,L] | |
RewriteCond %{REQUEST_FILENAME}.html -f | |
RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [QSA,L] | |
ErrorDocument 404 /404.html |
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
// When wrapping a function, such as console.log for example, | |
// you should use the implicit arguments object rather than | |
// passing in your own parameters. | |
// Examples: | |
// Bad | |
var logWrapper = function (message) { | |
console.log(message); | |
}; |
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
/* Sane box model */ | |
html { | |
box-sizing: border-box; | |
} | |
*, | |
*:before, | |
*:after { | |
box-sizing: inherit; | |
} |
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
// Config | |
$container-width: 96% !default; | |
$container-max-width: 1200px !default; | |
$grid-base-outer-width: 940 !default; | |
$grid-base-col-width: 60 !default; | |
$grid-base-gutter-width: 20 !default; | |
$grid-cols: 12 !default; | |
// Clearfix |
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 checkWidth() { | |
var viewportWidth = window.innerWidth; | |
// If the viewport width is greater than 640px | |
if (viewportWidth > 640) { | |
// Execute your code | |
} else { | |
// Do something else | |
} |
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
/* | |
JavaScript class helpers | |
See: http://toddmotto.com/creating-jquery-style-functions-in-javascript-hasclass-addclass-removeclass-toggleclass/ | |
*/ | |
function hasClass(elem, className) { | |
return new RegExp(" " + className + " ").test(" " + elem.className + " "); | |
} | |
function addClass(elem, className) { |
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
require 'date' | |
require 'facets/integer/ordinal' | |
module Jekyll | |
module DateFilter | |
def prettydate(date) | |
"#{date.strftime('%e').to_i.ordinalize} #{date.strftime('%B')} #{date.strftime('%Y')}" | |
end | |
end | |
end |