Skip to content

Instantly share code, notes, and snippets.

@saito-sv
saito-sv / elgordino-hasura.tf
Created January 14, 2020 02:47 — forked from coco98/elgordino-hasura.tf
Terraform spec for Hasura on Fargate and RDS
provider "aws" {
region = "${var.region}"
}
### VPC
# Fetch AZs in the current region
data "aws_availability_zones" "available" {}
resource "aws_vpc" "datastore" {
cidr_block = "172.17.0.0/16"
@saito-sv
saito-sv / osx_bootstrap.sh
Created April 2, 2019 19:06 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@saito-sv
saito-sv / ICloudUserIDProvider.swift
Created March 23, 2019 06:34 — forked from bizz84/ICloudUserIDProvider.swift
Code to get iCloud unique user ID or prompt user to sign in to iCloud
import CloudKit
enum ICloudUserIDResponse {
case success(record: CKRecordID)
case failure(error: Error)
case notSignedIn(accountStatus: CKAccountStatus)
}
class ICloudUserIDProvider: NSObject {
@saito-sv
saito-sv / slideup.swift
Last active March 11, 2020 17:46
Swift slide up modal view
//
// SlideUp.swift
//
// Created by Marlon Monroy on 1/29/19.
// Copyright © 2019 Monroy.io. All rights reserved.
//
import UIKit
class InstantPan: UIPanGestureRecognizer {
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent) {
@saito-sv
saito-sv / media-query.css
Created December 17, 2018 19:51 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
// Created by Marlon Monroy on 3/3/18.
// Copyright © 2018 Self-in. All rights reserved.
//
import UIKit
import AVFoundation
class CroppingFrame: UIView {
let mover = UIView()
override init(frame: CGRect) {
super.init(frame: frame)
layer.borderWidth = 2
@saito-sv
saito-sv / Login.js
Created September 28, 2018 05:38 — forked from bruce/Login.js
React + Redux + localStorage Login example
// components/Login/Login.js
class Login extends Component {
// ...
handleSubmit(evt) {
evt.preventDefault();
this.props.mutate(this.state)
.then(({ data }) => {
import UIKit
extension UIImage {
// colorize image with given tint color
// this is similar to Photoshop's "Color" layer blend mode
// this is perfect for non-greyscale source images, and images that have both highlights and shadows that should be preserved
// white will stay white and black will stay black as the lightness of the image is preserved
func tint(tintColor: UIColor) -> UIImage {
@saito-sv
saito-sv / Shimmer.swift
Last active June 24, 2024 18:22
a simple shimmer view in swift
// Created by Marlon Monroy on 5/19/18.
// Copyright © 2018 Monroy.io All rights reserved.
//
import Foundation
import UIKit
protocol Shimmerable {
func start(count: Int) -> Void
@saito-sv
saito-sv / iOSReversePushNavigation.Swift
Last active September 23, 2021 17:03
iOS reverse push and pop navigation swift 3
import UIKit
class ResersableNav: UINavigationController {
var controllersCount:Int {
return reversedPushControllers.count + viewControllers.count
}
var reversedPushControllers:[UIViewController] = []
func reversePush(controller:UIViewController, animated:Bool) {
var controllers = self.viewControllers