Or: “Everybody likes being given a glass of water.”
By Merlin Mann.
It's only advice for you because it had to be advice for me.
| The regex patterns in this gist are intended only to match web URLs -- http, | |
| https, and naked domains like "example.com". For a pattern that attempts to | |
| match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502 | |
| License: https://opensource.org/license/bsd-3-clause | |
| # Single-line version: | |
| (?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps |
| // Source for the Accidental Tech Podcast (ATP) T-Shirt: | |
| // http://www.marco.org/2014/04/29/atp-shirts | |
| // | |
| // By Troy Gaul, June 2, 2014. | |
| // | |
| // Based on Obj-C veresion by Marco Arment, April 28, 2014. MIT license. | |
| // https://gist.github.com/marcoarment/2542cd28cb5df0aa97d8 | |
| import UIKit |
| require "erb" | |
| require "pathname" | |
| DOT_TEMPLATE=<<-END | |
| digraph { | |
| size="20,20"; | |
| overlap=false; | |
| sep=0.4; | |
| graph [fontname=Helvetica,fontsize=10]; | |
| node [fontname=Helvetica,fontsize=10]; |
| #!/usr/bin/ruby -W1 | |
| # frozen_string_literal: true | |
| require 'optparse' | |
| require 'shellwords' | |
| # A script to automate changelog generation from Git commit messages | |
| # | |
| # For use with a git-flow workflow, it will take changes from the last tagged | |
| # release where commit messages contain NEW, FIXED, CHANGED, and IMPROVED |
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: blue; icon-glyph: brain; | |
| let items = await loadItems() | |
| if (config.runsInWidget) { | |
| let widget = await createWidget(items) | |
| Script.setWidget(widget) | |
| } else if (config.runsWithSiri) { | |
| let firstItems = items.slice(0, 5) | |
| let table = createTable(firstItems) |
| // | |
| // MIT License | |
| // | |
| // Copyright (c) 2024 Sophiestication Software, Inc. | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is |
| import SwiftUI | |
| extension ShapeStyle { | |
| // Based on https://gist.github.com/sophiateutschler/54c0e6ca490fee658e303a63487dc382 | |
| func smoothShadow( | |
| color: Color = Color(white: 0.0, opacity: 1.0 / 3.0), | |
| layers: Int = 3, | |
| curve: UnitCurve = .easeInOut, | |
| radius baseRadius: CGFloat, | |
| x baseX: CGFloat = 0.0, |