Skip to content

Instantly share code, notes, and snippets.

View DenisDov's full-sized avatar
🏠
Working from home

Denys Dovzhenko DenisDov

🏠
Working from home
View GitHub Profile
@jherax
jherax / filterArray.js
Last active February 23, 2024 12:59
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
@jremi
jremi / emoji-loop.js
Last active November 22, 2021 01:19
For loop to display emoji icon
var imgSource = 'http://fonts.voxmedia.com/emoji/unicode/1f4a9.png';
var txtSource = "shit ♥ ";
var valueInput = prompt("How many shit faces?");
for (var a = 1; a <= valueInput; a++) {
$("#container").add("div").attr('id', "image" + a);
$("#image" + a).append("<img class = 'emojiIcon' src=" + imgSource + ">");
$("#container").add("div").attr('id', "text" + a);
$("#text" + a).append("<h3 class = 'emojiNumber'>" + txtSource + a + "</h3>");
}
@lopspower
lopspower / README.md
Last active May 2, 2024 13:00
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@agragregra
agragregra / gist:7ae9c76e895b3bacd944
Last active December 4, 2022 16:43
Sublime Text My Settings
// Keymap (Windows Users):
[
{ "keys": ["alt+shift+f"], "command": "reindent" },
]
// Settings:
{
"auto_complete": false,
"bold_folder_labels": true,
"close_windows_when_empty": false,
@parmentf
parmentf / GitCommitEmoji.md
Last active May 2, 2024 20:29
Git Commit message Emoji
@agragregra
agragregra / mfp-blurred.css
Last active July 4, 2023 22:22
Magnific-Popup Blurred Background
CSS:
* {
transition: filter .25s ease;
}
.mfp-wrap ~ * {
filter: blur(1px);
}
Sass:
*
HTML:
<div class="wrapper">
<div class="tabs">
<span class="tab">Вкладка 1</span>
<span class="tab">Вкладка 2</span>
<span class="tab">Вкладка 3</span>
</div>
<div class="tab_content">
<div class="tab_item">Содержимое 1</div>
<div class="tab_item">Содержимое 2</div>
function heightDetect() {
$(".main_head").css("height", $(window).height());
};
heightDetect();
$(window).resize(function() {
heightDetect();
});
<?php echo get_post_meta($post->ID, 'year', true); ?>
<?php
$post = $wp_query->post;
if (in_category('cat_label_1')) {
include(TEMPLATEPATH.'/single-cat_label_1.php');
} elseif (in_category('cat_label_2')) {
include(TEMPLATEPATH.'/single-cat_label_2.php');
}
?>