Skip to content

Instantly share code, notes, and snippets.

View mongris's full-sized avatar

M mongris

  • Auckland, New Zealand
View GitHub Profile
@mongris
mongris / CurvedArrow.js
Created February 18, 2021 05:06 — forked from gaearon/CurvedArrow.js
Curved SVG arrow between two objects (rects or circles) https://twitter.com/dan_abramov/status/1362255543721672704
// from/to: { left, top, width, height, shape: 'circle' | 'rect' }
function CurvedArrow({ from, to }) {
function curvedHorizontal(x1, y1, x2, y2) {
function pos(t) {
let mx = x1 + (x2 - x1) / 2;
let p1 = {x: x1, y: y1};
let p2 = {x: mx, y: y1};
let p3 = {x: mx, y: y2};
let p4 = {x: x2, y: y2};
return {
@mongris
mongris / TipsView.swift
Created July 5, 2020 04:27 — forked from stammy/TipsView.swift
SwiftUI MicroAnimation example
//
// TipsView.swift
// Stonks
//
// Created by Paul Stamatiou on 7/3/20.
//
import SwiftUI
import PlaygroundSupport
import SwiftUI
import PlaygroundSupport
// constants
let cardWidth: CGFloat = 343
let cardHeight: CGFloat = 212
let spacing = 36
let animation = Animation.spring()
let cardColors = [
Color(UIColor.systemRed),
import SwiftUI
import PlaygroundSupport
// constants
let deviceWidth: CGFloat = 320
let deviceHeight: CGFloat = 568
let hasFaceID = true // false for TouchID
struct Device: View {
var body: some View {
import SwiftUI
import PlaygroundSupport
// NOTE: this example currently only works with US-based coordinates
// constants
// New York
let latitude = 40.709335
let longitude = -73.956558
import SwiftUI
import SafariServices
import PlaygroundSupport
// lil news api
let apiURL = "https://api.lil.software/news"
struct News: Codable {
var articles: [Article]
}
import SwiftUI
import PlaygroundSupport
struct Desktop: View {
var body: some View {
ZStack {
// Image(uiImage: #imageLiteral(resourceName: "IMG_6281.JPG"))
Color(UIColor.systemBlue)
macOS()
}
//
// ContentView.swift
// AnimationTimingCurve
//
// Created by Chris Eidhof on 25.09.19.
// Copyright © 2019 Chris Eidhof. All rights reserved.
//
import SwiftUI
@mongris
mongris / gist:8d32b359a40c640a2caebed9fb97dfeb
Created March 15, 2018 04:12
List iOS fonts with swift single line
UIFont.familyNames.forEach{ print($0); UIFont.fontNames(forFamilyName: $0).forEach{ print(" ", $0) } }
@mongris
mongris / emojis.json
Created December 18, 2017 02:15 — forked from oliveratgithub/emojis.json
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "👩‍👩‍👧‍👧", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "👩‍👩‍👧‍👦", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "👩‍👩‍👦‍👦", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "👨‍👩‍👧‍👧", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👦", "name": "family_children", "shortname": "", "unicode": "", "html": "👨‍👩‍👧‍👦", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👦‍👦", "name": "family_two_biys", "shortname": "", "unicode": "", "html": "👨&zw