Skip to content

Instantly share code, notes, and snippets.

@zaydek-old
zaydek-old / flex-primer.html
Last active May 24, 2018 09:39
A *simple* primer for understanding Flexbox with semantic classes https://zaydek.com/flex
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
:root {
/* twitter colors */
--orange : #FF691F;
{
"workbench.statusBar.visible": false,
"explorer.openEditors.visible": 0,
"workbench.activityBar.visible": false,
"editor.minimap.enabled": false,
"workbench.colorTheme": "Coffee (rainglow)",
"editor.tabCompletion": true,
"editor.fontSize": 14,
"editor.fontFamily": "Monaco, Menlo, 'Courier New', monospace",
"workbench.editor.showTabs": false,
@morrxy
morrxy / check-empty.md
Created August 16, 2017 11:35
[template check empty value] #golang
// Taken from Douglas Crockford's JavaScript: The Good Parts
function walkDOM(node, func) {
func(node);
node = node.firstChild;
while(node) {
walkDOM(node, func);
node = node.nextSibling;
}
}
###
import sys, requests
requests.get("https://api.robinhood.com/quotes/" + sys.argv[1] + "/")
###
import sys, json
@wiledal
wiledal / template-literals-3-for-loops.js
Last active January 1, 2025 06:18
Template Literals example: For loops
/*
Template literals for-loop example
Using `Array(5).join(0).split(0)`, we create an empty array
with 5 items which we can iterate through using `.map()`
*/
var element = document.createElement('div')
element.innerHTML = `
<h1>This element is looping</h1>
${Array(5).join(0).split(0).map((item, i) => `

Mobile Safari's 100% Height Dilemma

Whether you're developing a web application with native-ish UI, or just a simple modal popup overlay that covers the viewport, when it comes to making things work on iDevices in Mobile Safari, you're in for a decent amount of pain and suffering. Making something "100% height" is not as easy as it seems.

This post is a collection of Mobile Safari's gotchas and quirks on that topic, some with solutions and fixes, some without, in good parts pulled from various sources across the internets, to have it all in one place. Things discussed here apply to iOS8, iOS9 and iOS10.

The Disappearing Browser Chrome

Screen real estate on smartphones is limited, so Mobile Safari collapses the browser chrome (address bar and optional tab bar at the top, and tool bar at the bottom) when the user scrolls down. When you want to make something span exactly the height of the viewport, or pin something to the bottom of the screen, this can get tricky because the viewport changes size (or

@ahmdrz
ahmdrz / subdomains.go
Created October 10, 2016 06:29
How to use SubDomains in Golang , Subdomains With Go , http://codepodu.com/subdomains-with-golang/
//
// Please read http://codepodu.com/subdomains-with-golang/
// It's just copy and paste :smile:
//
//
// URLs :
// http://admin.localhost:8080/admin/pathone
// http://admin.localhost:8080/admin/pathtwo
// http://analytics.localhost:8080/analytics/pathone
// http://analytics.localhost:8080/analytics/pathtwo
@inexorabletash
inexorabletash / @ Intl.Segmenter polyfill.md
Last active January 5, 2021 17:53
Intl.Segmenter polyfill

Following proposal by @littledan

THIS NO LONGER MATCHES THE PROPOSED API AND SHOULD NOT BE USED

Just proof-of-concept. Do not use in production.

Caveats:

@bendc
bendc / easing.css
Created September 23, 2016 04:12
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);