Skip to content

Instantly share code, notes, and snippets.

View Kiwka's full-sized avatar
🦄
Let's make this world a better place to live in

Olena Sovyn Kiwka

🦄
Let's make this world a better place to live in
View GitHub Profile
@Kiwka
Kiwka / EmailMarkupBackgroundImage.html
Last active August 29, 2015 14:27
Hack to make background image visible in the email in the Outlook
<td background="http://images.freeimages.com/images/previews/df1/coffee-beans-2-1564474.jpg" bgcolor="#ffe08a" width="600" height="200" valign="top" styles="background-image: url(http://images.freeimages.com/images/previews/df1/coffee-beans-2-1564474.jpg);">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:600px;height:200px;">
<v:fill type="tile" src="http://images.freeimages.com/images/previews/df1/coffee-beans-2-1564474.jpg" color="#ffe08a" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div>
<!-- Paste your content here -->
</div>
<!--[if gte mso 9]>
@Kiwka
Kiwka / EmailMarkupBackgroundImage_Text.html
Last active November 6, 2023 19:14
Hack to make text centered on the background image in the email in the Outlook
<td background="http://images.freeimages.com/images/previews/df1/coffee-beans-2-1564474.jpg" bgcolor="#ffe08a" width="600" height="200" valign="middle" styles="vertical-align: middle; background-image: url(http://images.freeimages.com/images/previews/df1/coffee-beans-2-1564474.jpg);">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:600px;height:200px;">
<v:fill type="tile" src="http://images.freeimages.com/images/previews/df1/coffee-beans-2-1564474.jpg" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div>
<table width="600" border="0" cellpadding="0" cellspacing="0" align="center" style="width:600px; height: 200px;">
<tr>
<td valign="middle" style="vertical-align: middle; text-align: center; height: 200px;" height="200">
var brands = ['Nike', 'New Balance', 'Adidas', 'asics', 'Adidas', 'New Balance', 'New Balance', 'Nike', 'Adidas', 'asics'];
var newMap = {};
var max = 1;
var maxItem = brands[0];
brands.forEach(function(item, index, array){
if(!newMap[item]) {
newMap[item] = 1;
} else {
newMap[item]++;
var t = {'nike': 5};
var brands = [t, 'New Balance', 'Adidas', 'asics', t, 'New Balance', t, 'Nike', t, 'asics'];
var newMap = [];
var quantities = [];
var max = 0;
var maxItem;
brands.forEach(function(item, index, array){
if(newMap.indexOf(item) < 0) {
newMap.push(item);
@Kiwka
Kiwka / currentColor as a first available CSS variable.markdown
Created March 16, 2016 20:48
currentColor as a first available CSS variable
@Kiwka
Kiwka / gist:a0aabbec9c3bbaf2f1ee9eeeaa6a25fa
Created February 2, 2018 12:22
Toggle dropdown on keydown
<script>
document.addEventListener("DOMContentLoaded", () => {
$('.w-dropdown-toggle').on('keydown', e => {
if (e.keyCode === 13) {
const $toggle = $(e.target).closest('.w-dropdown-toggle');
const $list = $toggle.closest('.w-dropdown').children('.w-dropdown-list');
const opened = 'w--open';
if ($toggle.hasClass(opened)) {
$toggle.removeClass(opened);
$list.removeClass(opened);
@Kiwka
Kiwka / .flowconfig
Last active March 22, 2019 11:44
fix for flow error on html loading by empty npm package
// place this one in the [options] section in your flowconfig
module.name_mapper='.*\(.html\)' -> 'empty/string'
@Kiwka
Kiwka / .flowconfig
Last active March 22, 2019 11:45
fix for flow error on html loading by adding resolvable extensions
// place this one in the [options] section in your flowconfig
module.name_mapper='^raw-loader!\(.*\.html?\)' -> '\1'
module.file_ext=.html
module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
@Kiwka
Kiwka / .flowconfig
Last active March 22, 2019 11:45
fix for flow error on html loading by adding mimic typing of expected output of raw-loader
// place this one in the [options] section in your flowconfig
module.name_mapper='^raw-loader!\(.*\.html?\)' -> '<PROJECT_ROOT>/flow-typed/raw-loader.js'
@Kiwka
Kiwka / .flowconfig
Last active March 22, 2019 11:45
fix for flow error on html loading by adding declaration for raw-loader module
// place this one in the [options] section in your flowconfig
module.name_mapper='^raw-loader!\(.*\.html?\)' -> 'raw-loader'