Skip to content

Instantly share code, notes, and snippets.

View u10int's full-sized avatar

Nicholas Shipes u10int

View GitHub Profile
// Bigger iPhones = any Max, any Plus, iPhone XR, iPhone 11
switch (UITraitCollection.current.horizontalSizeClass, UITraitCollection.current.verticalSizeClass) {
case (.compact, .compact):
// Smaller iPhones in landscape
case (.compact, .regular):
// iPhones in portrait
// iPads in portrait during any split screen,
@u10int
u10int / ECEF2LLA.java
Created December 28, 2022 20:46 — forked from klucar/ECEF2LLA.java
Java stubs for converting ECEF (Earth Centered Earth Fixed) coords to Latitude Longitude Altitude
/*
*
* ECEF - Earth Centered Earth Fixed
*
* LLA - Lat Lon Alt
*
* ported from matlab code at
* https://gist.github.com/1536054
* and
* https://gist.github.com/1536056
@u10int
u10int / gsap-properties-cheat-sheet.md
Created July 15, 2022 00:36 — forked from lunelson/gsap-properties-cheat-sheet.md
Greensock Properties Cheat Sheet

Greensock CSS properties Cheat Sheet

I wrote this as a reference for myself because some of the property names are non-obvious, and there are a number of relevant special properties, and there is no central concise listing of them all in GSAP Docs, other than (in longer form) on the CSSPlugin page.

Standard CSS properties

...are all supported, with hyphenated-names becoming camelCaseNames. Non-animatable properties are also supported but they will be set at the beginning of the tween.

Special mentions:

@u10int
u10int / what-forces-layout.md
Created May 14, 2022 16:44 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
var cameraZ = camera.position.z;
var planeZ = 5;
var distance = cameraZ - planeZ;
var aspect = viewWidth / viewHeight;
var vFov = camera.fov * Math.PI / 180;
var planeHeightAtDistance = 2 * Math.tan(vFov / 2) * distance;
var planeWidthAtDistance = planeHeightAtDistance * aspect;
// or
#!/bin/sh
# make sure you have imagemagick installed: brew install imagemagick
# your app_icons.sh file should have the correct permissions: run `chmod 775 app_icons.sh` in your terminal from where you put this file
# put your `my_icon.png` next to this file and run ./app_icons.sh to export your app icons
x=my_icon.png
y=${x%.*}
# delete the export directory so we start clean
@u10int
u10int / glsl.json
Created November 13, 2020 21:42 — forked from lewislepton/glsl.json
GLSL snippets for visual studio code/kode studio
/*
AUTO-COMPLETE SNIPPETS FOR GLSL WITHIN VISUAL CODE STUDIO
Lewis Lepton
https://lewislepton.com
useful places that i grabbed info from
http://www.shaderific.com/glsl
https://www.khronos.org/opengl/wiki/OpenGL_Shading_Language
plus various other papers & books
*/
@u10int
u10int / StringExtensionHTML.swift
Created December 28, 2019 01:02 — forked from mwaterfall/StringExtensionHTML.swift
Decoding HTML Entities in Swift
// Very slightly adapted from http://stackoverflow.com/a/30141700/106244
// 99.99% Credit to Martin R!
// Mapping from XML/HTML character entity reference to character
// From http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
private let characterEntities : [String: Character] = [
// XML predefined entities:
""" : "\"",
"&" : "&",
@u10int
u10int / aeris-js-interactivemap-basic.html
Last active May 7, 2019 23:12
AerisWeather JS SDK - Basic InteractiveMap Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AerisJS Interactive Maps</title>
<link rel="stylesheet" type="text/css" href="./aerisjs-int-map-styles.css">
<style>
body {
font-family: 'Helvetica','Arial',sans-serif;
}
@u10int
u10int / post-archive-script.sh
Created January 29, 2019 17:11 — forked from intere/post-archive-script.sh
@macbellingrath pointed out that Xcode 10 had a change and line 80 needed to be updated.
#################################################################################################################################################
# post-archive-script.sh
#
# The purpose of this script is to create a universal binary for your framework
# Also - if there is a problem with steps in this script, then it should be
# easy to debug! Other scripts that this is based off of aren't so easy to debug.
#
#################################################################################################################################################