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 / 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
@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 {