Skip to content

Instantly share code, notes, and snippets.

View kaskad88's full-sized avatar

Dmytro Bartoshchak kaskad88

  • Ukraine
View GitHub Profile
@kaskad88
kaskad88 / javascript.translit.js
Created April 3, 2020 14:57 — forked from croisillon/javascript.translit.js
JavaScript translater russian to translit
function rus_to_latin ( str ) {
var ru = {
'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd',
'е': 'e', 'ё': 'e', 'ж': 'j', 'з': 'z', 'и': 'i',
'к': 'k', 'л': 'l', 'м': 'm', 'н': 'n', 'о': 'o',
'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u',
'ф': 'f', 'х': 'h', 'ц': 'c', 'ч': 'ch', 'ш': 'sh',
'щ': 'shch', 'ы': 'y', 'э': 'e', 'ю': 'u', 'я': 'ya'
}, n_str = [];
@kaskad88
kaskad88 / elementor font hook
Last active October 6, 2017 15:30 — forked from merianos/functions.php
Elementor custom fonts in font control
/**
* Responsible to modify the fonts list in the font control.
*/
function modify_controls( $controls_registry ) {
// First we get the fonts setting of the font control
$fonts = $controls_registry->get_control( 'font' )->get_settings( 'fonts' );
// Then we append the custom font family in the list of the fonts we retrieved in the previous step
$new_fonts = array_merge( [ 'Custom Font Family Name' => 'system' ], $fonts );
// Then we set a new list of fonts as the fonts setting of the font control
$controls_registry->get_control( 'font' )->set_settings( 'fonts', $new_fonts );