Skip to content

Instantly share code, notes, and snippets.

View trevorturk's full-sized avatar

Trevor Turk trevorturk

  • Chicago
View GitHub Profile
@lukaskubanek
lukaskubanek / Bundle+TestFlight.swift
Last active April 26, 2024 08:48
A code snippet for detecting the TestFlight environment for a macOS app at runtime
/// MIT License
///
/// Copyright (c) 2021 Lukas Kubanek, Structured Path GmbH
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction, including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
/// copies of the Software, and to permit persons to whom the Software is
/// furnished to do so, subject to the following conditions:
@bruno-
bruno- / async.rb
Created November 5, 2021 21:11
Threads vs Async Ruby
require "async"
CONCURRENCY = 1000
ITERATIONS = 100
def work
Async do |task|
CONCURRENCY.times do
task.async do
sleep 1
@tomholford
tomholford / install_pg_gem.md
Last active April 18, 2024 20:37
Install postgresql gem `pg` on macOS

Installing pg gem on macOS

If you're trying to install the postgresql gem pg and it is failing with the following error message:

Installing pg 1.2.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: ~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/pg-1.2.3/ext
~/.rbenv/versions/3.0.0/bin/ruby -I ~/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -r ./siteconf20210125-97201-pycpo.rb extconf.rb
@hishma
hishma / CLLocation+Encodable.swift
Created January 16, 2019 23:57
CoreLocation and Codable
extension CLLocation: Encodable {
public enum CodingKeys: String, CodingKey {
case latitude
case longitude
case altitude
case horizontalAccuracy
case verticalAccuracy
case speed
case course
case timestamp
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@mrrooijen
mrrooijen / README.md
Created May 6, 2018 04:14
How to enable SSL with Redis (Ruby Driver) on RedisLabs.

How to enable SSL with [Redis] ([Ruby Driver]) on [RedisLabs].

Typically, this is how you'd connect to Redis:

Redis.new(url: ENV["REDIS_URL"])

Where REDIS_URL uses the following format:

@maxhis
maxhis / IAPHelper.swift
Created October 9, 2017 09:10
[iOS In App Purchase Helper] #swift #in_app_purchase
//
// IAPHelper.swift
// Bandwagon
//
// Created by Andy on 2017/9/27.
// Copyright © 2017年 Doraemon. All rights reserved.
//
import Foundation
import SwiftyStoreKit
@mmyoji
mmyoji / dynamo_scan_paging_with_ruby_sdk.md
Last active May 6, 2020 23:37
DynamoDB Scan paging w/ Ruby SDK