Skip to content

Instantly share code, notes, and snippets.

View vrease's full-sized avatar
🚀
Learning...

Jonathan Yngfors vrease

🚀
Learning...
View GitHub Profile
@MrChocolatine
MrChocolatine / TS - More precise return type method Date#toISOString.d.ts
Last active February 22, 2024 22:06
TypeScript – How to accurately type dates in ISO 8601 format
// In TS, interfaces are "open" and can be extended
interface Date {
/**
* Give a more precise return type to the method `toISOString()`:
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
*/
toISOString(): TDateISO;
}
type TYear = `${number}${number}${number}${number}`;
@kmelve
kmelve / Image.css
Created October 11, 2019 15:07
Lazyload Images from Sanity.io
.root {
display: block;
position: relative;
}
.lqip {
image-rendering: pixelated;
width: 100%;
opacity: 1;
transition: opacity 50ms 100ms ease-out;
@christopheranderton
christopheranderton / update-outdated-brew-casks.sh
Last active February 4, 2024 17:29
Upgrade outdated brew casks. One liner, and the ”official” way to do it without using different hacks or scripts. However, it does not really replace some scripts out there, as in-app updates is not seen by Homebrew.
# Upgrade / Update outdated casks installed.
# --------------------------------------------------------------------------------
# Looks for outdated casks and installs the the latest version.
# User data (like application preferences) is intact.
# Updated one liner (thanks Henrik242)
# --------------------------------------------------------------------------------
brew upgrade $(brew outdated --cask --greedy --quiet)
@jaydenseric
jaydenseric / zeit-now-g-suite-setup.md
Created March 20, 2017 04:46
Zeit Now G Suite setup

Run each of the following lines, replacing yourdomain.com and codehere with your details:

now dns add yourdomain.com @ TXT google-site-verification=codehere
now dns add yourdomain.com @ MX ASPMX.L.GOOGLE.COM 1
now dns add yourdomain.com @ MX ALT1.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com @ MX ALT2.ASPMX.L.GOOGLE.COM 5
now dns add yourdomain.com @ MX ALT3.ASPMX.L.GOOGLE.COM 10
now dns add yourdomain.com @ MX ALT4.ASPMX.L.GOOGLE.COM 10
@homaily
homaily / index.html
Created April 8, 2015 13:44
Whatsapp share button
<a alt="Whatsapp" href="whatsapp://send" data-text="Text to share" data-href="http://example.com/url-to-share" class="whatsapp wa_btn"><span class="ion-social-whatsapp"></span> Whatsapp</a>