Skip to content

Instantly share code, notes, and snippets.

View ryanmeisters's full-sized avatar

Ryan Meisters ryanmeisters

View GitHub Profile
@ryanmeisters
ryanmeisters / dwolla-integration.tests.ts
Last active May 9, 2022 00:11
Example of mocking firebase callable function authentication for testing
import test, { before as beforeAllInFile, after as afterAllInFile } from 'ava';
import { deactivateCustomer, DwollaTransferStatus } from '../src/util/dwolla';
import { TEST_USER_ID, TEST_USER_EMAIL } from './helper/mockAuth';
import { getTestPlaidLinkToken } from './helper/plaid';
import { testFunctions, clearEmulatorDatabase } from './helper/firebase';
import { getTestUserFundingSources, getTestUserPrivateDocumentData, getTestUserTotalBalance, getTestUserClearedBalance } from './helper/user-data';
import { getFirstDepositTransactionData } from './helper/transactions';
import { hasShape, verifyShape } from './helper/assert/joi-schema';
import { eventually } from './helper/assert/eventually';
import * as Joi from '@hapi/joi';
# file options
--exclude Pods
# format options
--allman false
--elseposition same-line
--header ignore
--patternlet hoist
--indent 2
--indentcase false
import Foundation
import ReactiveSwift
struct VoidResult: Codable {}
enum FunctionServiceError: Error {
case encodingError(_ error: Error)
case decodingError(_ error: Error)
case functonCallError(_ error: FunctionsError)
case error(_ error: Error)
private lazy var actionButton: UIButton = UIButton.create {
// Do
$0.backgroundColor = .blue
$0.setTitle(.., for: .normal)
// maybe add own constraints?
constrainSquare($0, withSideLength: 40)
// Don't
self.view.addSubview($0)
@ryanmeisters
ryanmeisters / XCUIApplication+Scrolling.swift
Created October 26, 2017 00:05
Scrolling helpers automated ui tests using XCUIApplication
extension XCUIApplication {
private struct Constants {
// Half way accross the screen and 10% from top
static let topOffset = CGVector(dx: 0.5, dy: 0.1)
// Half way accross the screen and 90% from top
static let bottomOffset = CGVector(dx: 0.5, dy: 0.9)
}
var screenTopCoordinate: XCUICoordinate {
@ryanmeisters
ryanmeisters / gist:b1bff4e16ed2578e43c28961777dce46
Last active February 7, 2017 21:24
Reactive extension for Realm 2.4 object property observing
extension Reactive where Base: Object {
func observe<T>(_ property: String, type: T) -> Observable<T> {
return Observable.create { observer in
let token = self.base.addNotificationBlock { change in
switch change {
case .change(let properties):
@ryanmeisters
ryanmeisters / gist:87844578df1261774500e7bce2f8164b
Created October 11, 2016 20:28
fastlane_legacy_build_output
Output with no legacy build api
[12:56:50]: -------------------------------------------------
[12:56:50]: --- Step: Verifying required fastlane version ---
[12:56:50]: -------------------------------------------------
[12:56:50]: Your fastlane version 1.105.0 matches the minimum requirement of 1.105.0 ✅
[12:56:50]: ------------------------------
[12:56:50]: --- Step: default_platform ---
[12:56:50]: ------------------------------
[12:56:50]: Driving the lane 'ios alpha' 🚀
def replace_project_bundle_identifiers(app_info)
# Should use this to replace bundle ids but currently causes gym to fail
# https://github.com/fastlane/fastlane/issues/6289
# app_info.all_targets.each { |target|
# update_app_identifier(
# xcodeproj: app_info.xcodeproj,
# plist_path: target.plist_path,
# app_identifier: target.app_id
# )
# }
<?php
/**
* Rewrite Shop Categories
*
* @wordpress-plugin
* Plugin Name: Rewrite Shop Categories
* Description: Allows categories and products both to have 'shop' base
* Author: Plant Ninja
*/