Skip to content

Instantly share code, notes, and snippets.

View jorgeneidem's full-sized avatar

Jørgen Eidem jorgeneidem

View GitHub Profile
@jorgeneidem
jorgeneidem / index.html
Created March 17, 2026 00:56
Page Pushing Popup
<button onclick="demo.showModal()">Push it real good.</button>
<dialog id="demo" class="push-z" closedby="any">
<section>
<header>
<button title="Close" onclick="demo.close()" class="material-symbols-outlined">close</button>
</header>
</section>
</dialog>
@jorgeneidem
jorgeneidem / index.html
Created March 15, 2026 10:26
Page Pushing Popup
<button onclick="demo.showModal()">Push it real good.</button>
<dialog id="demo" class="push-z" closedby="any">
<section>
<header>
<button title="Close" onclick="demo.close()" class="material-symbols-outlined">close</button>
</header>
</section>
</dialog>
@jorgeneidem
jorgeneidem / utf-spaces.js
Created October 25, 2023 08:19 — forked from daformat/utf-spaces.js
A list of the different UTF spaces
utfSpaces = [
{
name: 'Space',
utf: '\u0020',
html: ['&#x20;', '&#32;'],
breaking: true,
width: 'Typically 1/4 em',
unicode_category: 'Separator, Space',
matched_by_s_character_class: true
},
@jorgeneidem
jorgeneidem / System-ui font stack
Last active June 9, 2022 10:38
System font stack with system-ui, the generic font family that can be used in place of -apple-system and BlinkMacSystemFont
font-family: system-ui,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
@jorgeneidem
jorgeneidem / screen-width-height.swift
Created December 21, 2017 21:14
Get screen width and height
UIScreen.main.bounds.width
UIScreen.main.bounds.height
@jorgeneidem
jorgeneidem / LinearGradient Mask
Created December 6, 2017 14:37
Mask images with LinearGradient
<!-- Cleverness by Eirik Backer http://kirie.no/ -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Mask</title>
</head>
<body style="margin:0;min-height:100vh;background:url(https://placeimg.com/1000/562/any) 50%/cover">
@jorgeneidem
jorgeneidem / ratioFromHeight.swift
Created November 21, 2017 13:54
Switching on device height and grouping together devices with similar aspect ratio.
if UIDevice().userInterfaceIdiom == .phone {
switch (UIScreen.main.nativeBounds.height) {
case (1136...2208):
print("iPhone, 9:16 aspect ratio")
case (2436):
print("iPhone X, 375:812 aspect ratio")
default:
print("unknown phone")
}
} else if UIDevice().userInterfaceIdiom == .pad {