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);
<?php | |
/* | |
echo plural_form(42, array('арбуз', 'арбуза', 'арбузов')); | |
*/ | |
function plural_form($n, $forms) { | |
return $n%10==1&&$n%100!=11?$forms[0]:($n%10>=2&&$n%10<=4&&($n%100<10||$n%100>=20)?$forms[1]:$forms[2]); | |
} |
/** | |
* Takes a jQuery collection and wraps each 'groupSize' items with 'wrapHtml' | |
* Example: $('#Example span').wrapInGroups('<div/>', 4); | |
* Will wrap every 4 span's inside #Example with a div | |
* See for yourself: http://jsfiddle.net/M9ZFh/ | |
* Author: iMoses ([email protected]) | |
*/ | |
(function($) { | |
$.fn.wrapInGroups = function(wrapHtml, groupSize) { | |
var selector = this.selector; |
<?php | |
/** | |
* Функция склонения числительных в русском языке | |
* | |
* @param int $number Число которое нужно просклонять | |
* @param array $titles Массив слов для склонения | |
* @return string | |
**/ | |
$titles = array('Сидит %d котик', 'Сидят %d котика', 'Сидит %d котиков'); | |
function declOfNum($number, $titles) |
<?php | |
// Includes text RGB to show text as white or black. This value was calculated using; | |
// $brightness = sqrt( (R * R * .299) + (G * G * .587) + (B * B * .114) ) | |
// If $brightness was greater than 130, then the text was set to white | |
$ral_colours => array( | |
'RAL 1000' => array( | |
'rgb' => '190,189,127', | |
'name' => 'Green Beige', |
/** | |
* Open all external links in a new window | |
*/ | |
jQuery(document).ready(function($) { | |
$('a') | |
.filter('[href^="http"], [href^="//"]') | |
.not('[href*="' + window.location.host + '"]') | |
.attr('rel', 'noopener noreferrer') | |
.attr('target', '_blank'); | |
}); |
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \; |
<?php | |
class msOrderByPhoneHandler extends msOrderHandler { | |
public function getCustomerId() { | |
$order = $this->ms2->order->get(); | |
if (empty($order['phone'])) {return false;} | |
if ($this->modx->user->isAuthenticated()) { | |
$profile = $this->modx->user->Profile; |
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
<?php | |
/** | |
* Smarty plugin | |
* @package Smarty | |
* @subpackage plugins | |
* | |
* Smarty {phpthumb} function plugin | |
* | |
* Type: function<br> |