Skip to content

Instantly share code, notes, and snippets.

@stefl
stefl / fix.js
Created May 19, 2018 15:35
Fix for Next.js / React SSR meta tags have URL-encoded content
// React SSR renders out <meta tags with URL-encoded values.
// That's bad if you need query parameters in your URLs.
// Before: <meta property="og:image"
// content="https://makelight-prismic-images.imgix.net/7f97d951970bbb15a8b3744e4c69499ffe969d66_img_1010.jpg?w=1200&amp;h=630&amp;fit=crop&amp;crop=entropy&amp;auto=format&amp;ixlib=js-1.1.1" class="next-head"/>
// (Notice the &amp;s in the URL)
//
// After: <meta property="og:image"
// content="https://makelight-prismic-images.imgix.net/cfb3a074bfcab5793eded64ef077dd6260d6d89b_img_0578.jpg?w=1200&h=630&fit=crop&crop=entropy&auto=format&ixlib=js-1.1.1" class="next-head"/>
// (Notice &amp; is now correctly &
//
@schickling
schickling / _README.md
Last active January 4, 2024 09:37
Script to import and export docker-machine configurations to sync between hosts/collaborators

docker-machine import/export

Script to import and export docker-machine configurations to sync between hosts/collaborators

Export (on host A)

$ docker-machine ls
NAME       ACTIVE   DRIVER         STATE     URL                            SWARM   DOCKER    ERRORS
dev        -        digitalocean   Running   tcp://example.com:2376                 v1.10.1
@manigandham
manigandham / rich-text-html-editors.md
Last active June 10, 2024 15:49
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
set langmap=ёйцукенгшщзхъфывапролджэячсмитьбюЁЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ;`qwertyuiop[]asdfghjkl\\;'zxcvbnm\\,.~QWERTYUIOP{}ASDFGHJKL:\\"ZXCVBNM<>
nmap Ж :
" yank
nmap Н Y
nmap з p
nmap ф a
nmap щ o
nmap г u
nmap З P
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 23, 2024 05:34
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname