Skip to content

Instantly share code, notes, and snippets.

View apollonian's full-sized avatar

Abhishek Warokar apollonian

View GitHub Profile
@dejager
dejager / RoundedPolygon.swift
Created October 18, 2022 05:57
A SwiftUI Shape that draws a polygon with a given number of corners and a corner radius.
//
// RoundedPolygon.swift
//
// Created by Nate on 2022-10-17.
//
import SwiftUI
struct RoundedPolygon: Shape {
@kitze
kitze / missing-date-fns.js
Last active June 21, 2020 19:56
good ol' date-fns
import {
formatDistance,
isAfter,
isBefore,
endOfDay,
startOfDay,
isSameDay,
isSameSecond,
isSameMinute,
isSameHour,
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */