Skip to content

Instantly share code, notes, and snippets.

View crmitchelmore's full-sized avatar
☀️

Chris Mitchelmore crmitchelmore

☀️
View GitHub Profile
@cdennig
cdennig / azure-pipeline-with-keyvault.yaml
Last active March 20, 2023 15:07
Azure DevOps Terraform with KeyVault + Service Connection
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
variables:
- group: kvintegratedvargroup
steps:

Terraform over ARM any day

  • The JSON of ARM is so hard to read or write from scratch . it is super hierarchial and really cluttered . HCL is much more readable and even writing from scratch is not a pain
  • The interpolation is really way better in HCL compared to ARM . Eg: Inabaility to ingest a map as an interpolated value (for environment variables)
  • A bit of conditional operations (for each , ternary etc) in HCL.
  • Predictability: With the plan , it actually gives you what exactly will happen
  • Modularity with HCL (Dont get me started with Nested Syntax in ARM !!!) .
  • inability to create the resource group and the other resources in one template ? - why ?
  • Sematic versions (versions of api used etc) , cannot be declared as semantic parts of code.

ARM advantages

@nzaghini
nzaghini / Movie-test.js
Last active September 23, 2022 17:03
Apollo GraphQL Test Example with Jest
import fs from 'fs'
import { makeExecutableSchema } from 'graphql-tools'
import { graphql } from 'graphql'
// the actual resolvers
import resolvers from '../src/resolvers'
// the mock service
import mockMovieService from './mocks/mockMovieService'
// a nice structure for test cases
// found at https://hackernoon.com/extensive-graphql-testing-57e8760f1c25
@lattner
lattner / TaskConcurrencyManifesto.md
Last active April 21, 2024 09:43
Swift Concurrency Manifesto

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

Using Swift Package Manager with iOS

Step 1:

File > New > Project...

Step 2:

Create a Package.swift file in your root project directory, add dependencies, then run swift package fetch on the command line in the same directory. We’re not going to run swift build because it will just complain.

@turboladen
turboladen / psql_encoding.sql
Created October 2, 2013 08:46
Script for dealing with creating Postgres databases that complain with: ``` PG::InvalidParameterValue: ERROR: encoding UTF8 does not match locale en_US DETAIL: The chosen LC_CTYPE setting requires encoding LATIN1. ``` ...when trying to create the production DB. Taken from: http://stackoverflow.com/questions/13115692/encoding-utf8-does-not-match-…
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8'
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
@steipete
steipete / PSPDFUIKitMainThreadGuard.m
Last active March 10, 2024 19:23
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>
@alloy
alloy / gist:4952606
Last active August 19, 2020 03:48
Upload iOS application for clients on their iTunes Connect account.

Obviously, the simplest solution would be for the client to share their account details or add us as ‘team admin’, but that is not what this is about.

  1. [Add us to your iOS Developer Program as ‘team member’.][1]
  2. [Create a ‘Distribution Certificate’, if you haven’t got one already.][2]
  3. [Create a ‘App Store Distribution Provisioning Profile’.][3]
  4. [Export the ‘Distribution Certificate’ assets and send the export and password to us.][4] (For security sake, it’s a good idea to send us the password via other means than the exported certificate. E.g. by phone/SMS.)
@skeeet
skeeet / xcode_ramdisk.sh
Created April 12, 2012 13:35 — forked from MaximKeegan/xcode_ramdisk.sh
Create a RAM disk for using with XCode
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"