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
//Font Smoothing | |
//src: http://maximilianhoffmann.com/posts/better-font-rendering-on-osx | |
@mixin font-smoothing($value: on) { | |
@if $value == on { | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscale; | |
} | |
@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
// src: https://davidwalsh.name/javascript-debounce-function | |
// Returns a function, that, as long as it continues to be invoked, will not | |
// be triggered. The function will be called after it stops being called for | |
// N milliseconds. If `immediate` is passed, trigger the function on the | |
// leading edge, instead of the trailing. | |
function debounce(func, wait, immediate) { | |
var timeout; | |
return function() { |
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
//src: https://davidwalsh.name/window-open | |
someElement.addEventListener('click', function(e) { | |
var url = someElement.get('data-url'); | |
if(e.metaKey || e.ctrlKey || e.button === 1) { | |
window.open(url); | |
} | |
else { | |
window.location = url; |
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
/** | |
* Convert font-size from px to rem with px fallback | |
* | |
* @param $size - the value in pixel you want to convert | |
* | |
* e.g. p {@include fontSize(12px);} | |
* | |
*/ | |
// Function for converting a px based font-size to rem. |
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
@mixin not($ignorList...) { | |
//if only a single value given | |
@if (length($ignorList) == 1){ | |
//it is probably a list variable so set ignore list to the variable | |
$ignorList: nth($ignorList,1); | |
} | |
//set up an empty $notOutput variable | |
$notOutput: ''; | |
//for each item in the list | |
@each $not in $ignorList { |
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
<filesMatch "\.(html|htm|js|css)$"> | |
FileETag None | |
<ifModule mod_headers.c> | |
Header unset ETag | |
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" | |
Header set Pragma "no-cache" | |
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT" | |
</ifModule> | |
</filesMatch> |
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
<?php | |
function addUrlParam($url, $param) { | |
$url_parts = parse_url($url); | |
parse_str($url_parts['query'], $params); | |
$params[$param[0]] = $param[1]; | |
$url_parts['query'] = http_build_query($params); | |
//return http_build_url($url_parts); //pecl | |
return $url_parts['scheme'] . '://' . $url_parts['host'] . $url_parts['path'] . '?' . $url_parts['query']; | |
} |
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
@mixin breakpoint($class) { | |
@if $class == xs { | |
@media (max-width: 767px) { @content; } | |
} | |
@else if $class == sm { | |
@media (min-width: 768px) { @content; } | |
} | |
@else if $class == md { |
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
search/replace | |
Find what: ^\n | |
or | |
Find what: ^[\s]*?[\n\r]+ | |
Replace With: (nothing, leave in blank). |
OlderNewer