Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

André J eonist

🎯
Focusing
View GitHub Profile
@eonist
eonist / investor_CRM_markdown.md
Last active September 24, 2022 11:34
Investor CRM in markdown
View investor_CRM_markdown.md

Investor CRM in markdown

investor type priority relation intro path status Notes
Sequoia mega-vc low cold as ice gates of hell reconnect Sequoia.com
Rahul Vohra angle medium cold Ollie Forsyth reconnect superhuman.com / Antler.com

Status types:

  • dilligence 🧐
@eonist
eonist / ThreadSafeBox.swift
Created May 27, 2022 00:53
Thread safe value
View ThreadSafeBox.swift
/// `ThreadSafeBox` is a helper class that allows use of resource (value) in a thread safe manner.
/// All read and write calls are wrapped in concurrent `DispatchQueue` which protects writing to
/// resource from more than 1 thread at a time.
class ThreadSafeBox<T>: CustomDebugStringConvertible {
private let queue = DispatchQueue(label: "com.someurl.ThreadSafeBox")
fileprivate var value: T
init(value: T) {
self.value = value
}
@eonist
eonist / UIApp+Ext.swift
Last active February 24, 2022 15:43
Colorize status menu iOS 15
View UIApp+Ext.swift
/**
* Window and statusbar (iOS 15 etc)
*/
extension UIApplication {
/**
* - Note: Key Scene can be found by doing keyWin.windowScene
*/
public var keyWin: UIWindow? {
UIApplication
.shared
@eonist
eonist / UIFont+Ext.swift
Created June 26, 2021 14:38
bold notion for UIFont
View UIFont+Ext.swift
import UIKit.UIFont
/**
* Example: let titleLabel = UILabel()
* titleLabel.font = titleLabel.font.bold //no need to include size!
*/
var bold: UIFont {
return withTraits(traits: .traitBold)
}
func withTraits(traits: UIFontDescriptorSymbolicTraits...) -> UIFont {
let descriptor = self.fontDescriptor
@eonist
eonist / UILabel+Padding.swift
Created June 26, 2021 13:47
Makes it possible to add padding to UILabel.
View UILabel+Padding.swift
/**
* Makes it possible to add padding to UILabel.
* EXAMPLE: $0.padding = UIEdgeInsets(top: -10, left: 0, bottom: -10, right: 0)
*/
extension UILabel {
private struct AssociatedKeys {
static var padding = UIEdgeInsets()
}
public var padding: UIEdgeInsets? {
@eonist
eonist / Optional+Ext.swift
Created May 26, 2021 09:49
Print optionals
View Optional+Ext.swift
/**
* ## Example:
* let optionatVatue1: Int? = 32 // String interpolation produces a debug description for an optional
* let optionalVatue2: Int? = nil
* Swift print("value is \(optionatVatue1)")// did you mean to make this explicit?, Optional (32)
* print("\(optionalVatue1)") // Value is 32
* print("\(optionalVatue2)") // Value is nil
*/
extension String: StringInterpolation {
mutating func appendInterpotation<T: CustomStringConvertib1e>(value: T?) {
View Tailwind colors
.text-transparent color: transparent; Aa
.text-current color: currentColor; Aa
.text-black color: #000; Aa
.text-white color: #fff; Aa
.text-gray-100 color: #f7fafc; Aa
.text-gray-200 color: #edf2f7; Aa
.text-gray-300 color: #e2e8f0; Aa
.text-gray-400 color: #cbd5e0; Aa
.text-gray-500 color: #a0aec0; Aa
.text-gray-600 color: #718096; Aa
View gist:40d8c7f36e948e26b550441d5ccbfbef
Pink
#ff2d55
Purple
#5856d6
Orange
#ff9500
Yellow
@eonist
eonist / hamburger-menu.html
Created October 23, 2020 19:53
hamburger menu (uses only css)
View hamburger-menu.html
<!DOCTYPE html>
<html>
<head>
<title>Hamburger menu prototype</title>
<meta charset="UTF-8" />
<link rel="stylesheet" href="styles.css">
<meta name="viewport" content="width=device-width">
</head>
<body>
<div class="header">
View hasNil (operate on optional array)
/**
* Asserter
*/
extension Array {
/**
* Asserts if array has nil values
* ## Examples:
* let someArr: [Int?] = [1,2,nil]
* someArr.hasNil() // true
* [1,2,2].hasNil() // false