Skip to content

Instantly share code, notes, and snippets.

View grrrlikestaquitos's full-sized avatar
😁

Andrei grrrlikestaquitos

😁
View GitHub Profile
@grrrlikestaquitos
grrrlikestaquitos / swiftui-draggable-view.swift
Created July 2, 2019 06:27
SwiftUI - DraggableView, Reusable Component
// Creating a new HOC Component
struct DraggableView<C: View> : View {
@State private var drawerOffset = CGSize.zero
private let childView: C
init (_ childView: () -> (C)) {
self.childView = childView()
}
// Handling business logic for drag gesture and animations
@grrrlikestaquitos
grrrlikestaquitos / swiftui-draggable-view.swift
Created July 2, 2019 06:27
SwiftUI - DraggableView, Reusable Component
// Creating a new HOC Component
struct DraggableView<C: View> : View {
@State private var drawerOffset = CGSize.zero
private let childView: C
init (_ childView: () -> (C)) {
self.childView = childView()
}
// Handling business logic for drag gesture and animations
@grrrlikestaquitos
grrrlikestaquitos / swiftui-higher-order-component.swift
Last active September 24, 2022 17:09
SwiftUI: Higher Order Component Syntax
// Declaring ContainerView as a HOC
struct ContainerView<C: View> : View {
let childView: C
init(_ childView: () -> (C)) {
self.childView = childView()
}
var body: some View {
childView
@grrrlikestaquitos
grrrlikestaquitos / aws.sh
Created October 2, 2017 18:25
Connect to AWS EC2 Instance Quicker - Command Line
#!/bin/bash
alias aws=aws
# Root Command
function aws() {
if [[ $# -eq 0 ]]; then
echo "Incomplete: Please pass in a server to connect to"
else
connect $1