View fn_map_list.scss
@function merge-maps($map1, $map2, $merge-lists: false) { | |
@if (type-of($map1) == map or (type-of($map1) == list and length($map1) == 0)) and (type-of($map2) == map or (type-of($map2) == list and length($map2) == 0)) { | |
$result: $map1; | |
@each $key, $value in $map2 { | |
@if (type-of(map-get($result, $key)) == map and type-of($value) == map) { | |
$result: map-merge($result, ($key: recursive-map-merge(map-get($result, $key), $value))); | |
} | |
@else if ($merge-lists and type-of(map-get($result, $key)) == list and type-of($value) == list) { | |
$result: map-merge($result, ($key: join(map-get($result, $key), $value))); | |
} |
View _color-maps.scss
// stylelint-disable declaration-no-important | |
// Extra color maps | |
$blues: ( | |
"100": $blue-100, | |
"200": $blue-200, | |
"300": $blue-300, | |
"400": $blue-400, | |
"500": $blue-500, | |
"600": $blue-600, |
View template.html
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="JS binding and template tag"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS binding and template tag</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script> | |
</head> | |
<body> |
View ArrayConverter.php
<?php | |
class ArrayConverter | |
{ | |
protected const BRACE_OPEN = '('; | |
protected const BRACE_CLOSE = ')'; | |
/** | |
* @param array $tokens | |
* @return array |
View Enso\ReflectionFile.php
<?php | |
namespace Enso; | |
use Reflector; | |
use Reflection; | |
use ReflectionClass; | |
use ReflectionType; | |
use ReflectionNamedType; | |
use ReflectionFunctionAbstract; |
View Controller_CRUD.php
<?php | |
/** | |
* CRUD controller. | |
* | |
* @link https://en.wikipedia.org/wiki/Create,_read,_update_and_delete CRUD | |
* @link https://koseven.dev/documentation/kohana/tutorials/basic-controller Controller_Base | |
*/ | |
class Controller_CRUD extends Controller_Base | |
{ | |
/** |
View polyfill_getallheaders.php
<?php | |
if (! function_exists('getallheaders')) { | |
/** | |
* Returns HTTP headers for the server request. | |
* | |
* @return string[] The HTTP headers | |
*/ | |
function getallheaders() | |
{ | |
static $headers; |
View iana_languages.php
<?php | |
/** | |
* Returns language list parsed from site "iana.org" and grouped by type ('language', 'variant', 'extlang' and etc.). | |
* | |
* @param int $last_update timestamp (optional) | |
* @param string $url source URL (optional) | |
* @return array|null return NULL when list not updated | |
*/ | |
function iana_languages(int $last_update = null, string $url = null): ?array | |
{ |
View litresCoupons.js
// ==UserScript== | |
// @name litresCoupons | |
// @namespace litres.ru | |
// @version 0.1 | |
// @description Add coupons | |
// @author info@ensostudio.ru | |
// @include https://www.litres.ru/pages/put_money_on_account/* | |
// @include https://litres.ru/pages/put_money_on_account/* | |
// @require https://code.jquery.com/jquery-3.4.1.min.js | |
// @grant unsafeWindow |
NewerOlder