A mixin for writing @font-face rules in SASS.
Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.
@include font-face(Samplino, fonts/Samplino);| // Adaptive sprite. Scss functions | |
| // https://gist.github.com/MrSwed/9b74275a7c5fa82c78619f2b7b9bd4ba | |
| // based on less mixins | |
| // https://gist.github.com/MrSwed/162bc57a6225ff139d5299b6fb7944b3 | |
| // Defaults | |
| $fzr: 16px; // html rem | |
| $fz: $fzr; // body, current | |
| $SpriteImgUrl: url(../images/sprite.png); |
| @function strip-unit($num) { | |
| @return $num / ($num * 0 + 1); | |
| } | |
| @function calcSize($size,$base:16px,$unit:1rem,$calc:true) { | |
| // https://gist.github.com/MrSwed/958077f384bfeb62cc799b0946999590 | |
| @if ($calc) { | |
| @return calc(#{$unit} * #{strip-unit($size)} / #{strip-unit($base)}); | |
| } @else { | |
| @return $unit * $size / $base; |
| <?php | |
| /** | |
| * imageAutoSized | |
| * | |
| * ссылка на изображение соответственно одному из заданых разрешений устройств | |
| * | |
| * @category snippet | |
| * @version 0.2 | |
| * @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL) | |
| * @internal @properties |
| // Восстановление прототипа reduce на случай, если | |
| // криворукие разработчики написали (или не убрали) свой прототайп | |
| Array.prototype.myReduce = function(callback, initialVal) { | |
| var accumulator = (initialVal === undefined) ? undefined : initialVal; | |
| for (var i = 0; i < this.length; i++) { | |
| if (accumulator !== undefined) | |
| accumulator = callback.call(undefined, accumulator, this[i], i, this); | |
| else | |
| accumulator = this[i]; |
| @echo off | |
| rem https://gist.github.com/MrSwed/36abd8ed745e5717e9c0d926b2270137 | |
| rem 20191111_111148 11.11.2019 11:11:48.57 | |
| set datestr=%date:~-4%%date:~-7,2%%date:~-10,2%_%time:~-11,2%%time:~-8,2%%time:~-5,2% | |
| echo %datestr% %date% %time% |
| <?php | |
| if (!defined('MODX_BASE_PATH')) { die('HACK???'); } | |
| /** | |
| * HeaderModifiedSince | |
| * | |
| * Return header "HTTP/1.0 304 Not Modified" if HTTP_IF_MODIFIED_SINCE | |
| * | |
| * @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html | |
| * @author Sergey Davydov <dev@sdcollection.com> |
| # Add Filters: | |
| # thanks https://www.youtube.com/watch?v=kfqxnZ4yo3E | |
| youtube.com##.ytp-ce-covering-overlay | |
| youtube.com##.ytp-ce-element-shadow | |
| youtube.com##.ytp-ce-covering-image | |
| youtube.com##.ytp-ce-expanding-image | |
| youtube.com##.ytp-ce-element.ytp-ce-video.ytp-ce-element-show | |
| youtube.com##.ytp-ce-element.ytp-ce-channel.ytp-ce-channel-this | |
| youtube.com##.ytp-ce-element.ytp-ce-website |
| u=$USER | |
| if [ $1 ] | |
| then | |
| u=$1 | |
| shift | |
| fi | |
| log=/root/temp/$u.ai-$(date +"%Y%m%d%H%M%S").log.html | |
| php ai-bolit/ai-bolit/ai-bolit.php -p /home/$u/ -r $log $@ |
| $.fn.FitIn = function(o){ | |
| // Fit element to parent width by decrease font-size (js must be after css load) | |
| // https://gist.github.com/MrSwed/cd80923f28e91fe79386996668da1ecd | |
| o = $.extend({},{minFontSize:3}); | |
| return $(this).each(function(){ | |
| var fz = parseInt($(this).css("font-size")); | |
| do { | |
| $(this).css('font-size', fz--); | |
| } while (($(this).width() > $(this).parent().width()) && fz > o.minFontSize); | |
| }); |