This file contains hidden or 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 | |
/* acme_twig_helpers/src/TwigExtension.php */ | |
namespace Drupal\acme_twig_helpers; | |
use Drupal\Component\Utility\Html; | |
use Drupal\taxonomy\Entity\Term; | |
use Twig_Extension; | |
use Twig_SimpleFunction; |
This file contains hidden or 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
{ | |
"cities" : [ | |
{ | |
"name_ka" : "თბილისი", | |
"name_en" : "Tbilisi", | |
"location" : "41.7151377,44.82709599999998" | |
}, | |
{ | |
"name_ka" : "აბაშა", | |
"name_en" : "Abasha", |
This file contains hidden or 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
$(document).ready(function(){ | |
// ჩამოვიაროთ დოკუმენტის ყველა del ტეგი | |
$("del").each(function(){ | |
var $thisDel = $(this); | |
var $parentA = $thisDel.closest("a"); | |
var $childA = $("a", $thisDel); | |
// ვანაცვლებთ ასტერიკს del ტეგის შიგთავსში და ვაუქმებთ გადახაზვას | |
$thisDel.text( $thisDel.text().replace("*", "@") ).css("text-decoration", "none"); | |
This file contains hidden or 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
// წრფივი შემთხვევა | |
$weight = ($currentTagUses - $minUses) / ($maxUses - $minUses); | |
$fontSize = $minFontSize + round(($maxFontSize - $minFontSize)*$weight, 2); | |
// ლოგარითმული შემთხვევა | |
$weight = (log($currentTagUses) - log($minUses)) / (log($maxUses) - log($minUses)); | |
$fontSize = $minFontSize + round(($maxFontSize - $minFontSize)*$weight, 2); |
This file contains hidden or 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
SELECT tag, weight FROM `tags` ORDER BY RAND() LIMIT 50; |
This file contains hidden or 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
ul.menu { | |
display: table; | |
margin: 0 auto; | |
} | |
ul.menu li { | |
display: table-cell; | |
} |