Skip to content

Instantly share code, notes, and snippets.

View don1138's full-sized avatar
🐝

Don Schnitzius don1138

🐝
View GitHub Profile
@don1138
don1138 / webkit-only.css
Created September 5, 2016 10:12
Hack for Webkit
@media all and (-webkit-min-device-pixel-ratio: 1){
selectors {
properties: values;
}
}
/* via "Operating systems default sans-serif fonts" (https://fontsarena.com/blog/operating-systems-default-sans-serif-fonts) */
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Oxygen, Cantarell, sans-serif;
/* System Fonts as used by GitHub */
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
/* System Fonts as used by Medium and WordPress */
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
/* This parent can be any width and height */
.block {
text-align: center;
/* May want to do this if there is risk the container may be narrower than the element inside */
white-space: nowrap;
}
/* The ghost, nudged to maintain perfect centering */
.block:before {
@don1138
don1138 / list-separator-color.swift
Last active February 15, 2021 15:48
Set custom color on List Separator in SwiftUI (deprecated in iOS 14)
var body: some View {
// Add this right after declaring body view:
UITableView.appearance().separatorColor = UIColor(red:(128/255), green:(128/255), blue:(128/255), alpha: 1)
return NavigationView{
List {}
.navigationBarTitle("", displayMode: .inline)
.navigationBarHidden(true)
}
@don1138
don1138 / set-percentage-width.swift
Last active May 20, 2023 15:08
Use percentage widths on SwiftUI layout objects
// Get screen width and subtract Safe Area margins
var containerWidth:CGFloat = UIScreen.main.bounds.width - 32.0
// Set frame width of each column using (containerWidth * percentage)
HStack (spacing:0) {
HStack {
Text("Column 25% Width")
}
.frame(width: containerWidth * 0.25)
HStack {
@don1138
don1138 / easings.css
Created September 13, 2020 03:03 — forked from ControlledChaos/easings.css
Handy CSS properties for easing functions
:root {
--ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
--ease-in-cubic: cubic-bezier(0.55, 0.055, 0.675, 0.19);
--ease-in-quart: cubic-bezier(0.895, 0.03, 0.685, 0.22);
--ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06);
--ease-in-expo: cubic-bezier(0.95, 0.05, 0.795, 0.035);
--ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.335);
--ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
--ease-out-cubic: cubic-bezier(0.215, 0.61, 0.355, 1);
--ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
@don1138
don1138 / text-format-settings.swift
Last active April 1, 2023 16:02
Style settings for SwiftUI Text object
// Xcode - Text Formatting
// https://daddycoding.com/2019/12/26/swiftui-text/
Text("Sample Text")
.font(.system(
size: 15,
weight: .semibold,
design: .default // .default, .serif, .rounded, .monospaced
))
@don1138
don1138 / blender_python_modifier_chars.py
Last active September 23, 2020 06:15
Modifier Key Symbols for Text Labels
# If you want to use modifier keys symbols in your text labels, use these:
# Control ⌃
# Option/Alt ⌥
# Shift ⇧
# Command ⌘
@don1138
don1138 / blender-render.ipynb
Created August 9, 2022 08:04 — forked from AnnikenYT/blender-render.ipynb
Blender Render.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@don1138
don1138 / phi_cascade.py
Last active November 7, 2023 01:46
Phi, Ascending, Descending, and Exponent; and the Chessboard Rice values
import bpy
from math import sqrt
phi = (1 + sqrt(5)) / 2
# phi = 5 ** .5 * .5 + .5
# ASCENDING
e1 = [round((x * phi),3) for x in range(1,17)]
print(f"\nAscending = {e1}")