Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / .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 / 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 / converting-steps.md
Last active December 2, 2024 13:40
Converting Telegram Sticker (TGS) to Telegram Emoji (WEBM)

Requirements for Telegram emojis:

  • Video must be exactly 100x100 pixels in size
  • Video duration must not exceed 3 seconds.
  • Frame rate can be up to 30 FPS.
  • Video should be looped for optimal user experience.
  • Video size should not exceed 64 KB.
  • Video must be in .WEBM format encoded with the VP9 codec.
  • Video must have no audio stream.

Step 1