Skip to content

Instantly share code, notes, and snippets.

@Gennnji
Gennnji / gist:1df7ee399ee0919a633207e9a66d4ed3
Created December 7, 2020 09:43
Bulletproof backgrounds for emails
Here is an example of bulletproof background in emails for Gmail, Windows Mail, etc. and especially for Outlook.
It works with attribute "background" of td and fallback in VML for Outlook.
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td background="https://i.imgur.com/YJOX1PC.png" bgcolor="#7bceeb" valign="top">
<!--[if gte mso 9]>
<v:rect xmlns_v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="mso-width-percent:1000;">
<v:fill type="tile" src="https://i.imgur.com/YJOX1PC.png" color="#7bceeb" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
@Gennnji
Gennnji / .eslintrc
Last active July 13, 2020 12:24
Eslint config for Svelte example
module.exports = {
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module'
},
env: {
es6: true,
browser: true
},
extends: [
@Gennnji
Gennnji / masks.js
Created April 30, 2020 12:45
Phone Mask
const getPurePhone = (value) => {
if (!value) {
return '';
}
return value.replace(/\+7|[^\d]/g, '')
.replace(/^8(\d{10})$/, '$1');
}
const phoneMask = (value) => {
@Gennnji
Gennnji / Button.html
Last active April 6, 2020 15:17
Email markup examples
<!-- Universal Button (also for Outlook on Windows) with round corners, dynamic width and fixed paddings -->
<!--[if mso]>
<v:roundrect
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:w="urn:schemas-microsoft-com:office:word"
href="{{ link }}"
style="
height: 44px;
v-text-anchor: middle;
mso-wrap-style: none;
@Gennnji
Gennnji / openssl.cnf
Created April 2, 2020 17:50
Setup sirv-cli for Rollup with SSL and HTTP/2
# OpenSSL configuration to generate a new key with signing requst for a x509v3
# multidomain certificate
#
# openssl req -config bla.cnf -new | tee csr.pem
# or
# openssl req -config bla.cnf -new -out csr.pem
[ req ]
default_bits = 4096
default_md = sha512
default_keyfile = key.pem
@Gennnji
Gennnji / setup.sh
Created December 30, 2019 08:50
MacOS setup
# setup oh-my-zshell
# setup Sublime Text 3
mkdir ~/bin
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
@Gennnji
Gennnji / index.html
Created October 1, 2019 10:20
[CSS] Dynamical comma
<style>
span:not(:empty) + span:not(:empty):before {
content: ', ';
}
</style>
<span>+7 (985) 171-71-71</span><span>[email protected]</span>
<!--
Outputs to ===> +7 (985) 171-71-71, [email protected]
@Gennnji
Gennnji / Web-IE11-fixes.txt
Last active October 9, 2019 12:25
Frontend Development for IE11
1. Problems with inactive margin of elements inside flexbox.
Solution: Add pseudo-element ::after like
.element::after {
content: '';
display: block;
height: 20px;
}
2. Undesired phone number detection on a page with odd styling.
Solution: Add meta into head - <meta name="format-detection" content="telephone=no">.
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="${HOME}/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
#!/bin/sh -e
# 1) Disable of gnome control over keyboard:
gsettings set org.gnome.settings-daemon.plugins.keyboard active false
# 2) Set desired settings for xkb:
setxkbmap -option grp:rctrl_toggle,lv3:menu_switch us,ru