Skip to content

Instantly share code, notes, and snippets.

@ptz0n
ptz0n / _respond.scss
Created July 22, 2012 10:11
Sass respond to mixin
@mixin respond-to($media) {
@if $media == landscape {
@media screen and (min-width: 321px) { @content; }
}
@else if $media == tablet {
@media only screen and (min-width: 768px) { @content; }
}
@else if $media == desktop {
@media only screen and (min-width: 992px) { @content; }
}
@patricksurry
patricksurry / README.md
Last active January 7, 2024 08:05
Imitate hand-drawn (imperfect) circles using cubic Bézier segments

Imitate hand-drawn (imperfect) circles using cubic Bézier segments, based on a Bézier approximation to a perfect circle. TLDR: a good approximation to a quarter circle of unit radius is a cubic Bézier curve with control points P0 = (0,1), P1 = (c,1), P2 = (1,c), P3 = (1,0) where c = 0.551915024494. By varying the points in a sensible way, we can do a good impression of hand-drawn circles.

<?php
# hello
# this is pure crap, don't even think about using it
# it doesn't filter input vars or contain ANY error handling at all
# i wrote this while putting a kid to bed in, january 2016
# i repeat: do not use this script
# i am peder@earthpeople.se, a ceo - not a real developer
# prerequisites
# you need an account at mathem
@EvanBacon
EvanBacon / apple-touch-startup-image.html
Created April 17, 2019 07:10
An example of full iOS PWA startup image (splash screen) support.
<html>
<head>
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-title" content="Expo" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<link
rel="apple-touch-icon"
sizes="180x180"
@blacksaildivision
blacksaildivision / wp-head-clean.php
Last active April 19, 2023 11:12
Remove all unnecessary stuff from WordPress <head> tag
<?php
/**
* Alter dns-prefetch links in <head>
*/
add_filter('wp_resource_hints', function (array $urls, string $relation): array {
// If the relation is different than dns-prefetch, leave the URLs intact
if ($relation !== 'dns-prefetch') {
return $urls;
}