Skip to content

Instantly share code, notes, and snippets.

View arthurpalves's full-sized avatar
👨‍💻

Arthur Alves arthurpalves

👨‍💻
View GitHub Profile
@arthurpalves
arthurpalves / release_issue_template.md
Created February 19, 2021 09:24
Github Issue template to trigger a production release
name about title labels assignees
Release
Release a new version of the app
Release version X.Y.Z
release

Changelog

@arthurpalves
arthurpalves / .bashrc
Last active February 19, 2021 12:49
Notify me with a notification that a task has been completed
# USAGE:
# notify pod install --repo-update
# Place this function at the end of your file
notify() {
body=""
for parameter in $@
do
body+=" $parameter"
done
@arthurpalves
arthurpalves / ios-deploy.yml
Last active July 5, 2022 12:20
Sample of Github Actions workflows for iOS that falls under our "Branching strategy" category. These are workflows whose triggers are changes in or towards certain branches.
name: ios/deploy
#
# GOOD TO KNOW
#
# This workflow is supposed to:
# 1. Help ensure the quality of the code changes; and
# 2. Deploy a variant of this application depending on
# which branch was changed.
#
@arthurpalves
arthurpalves / close_issue.yml
Created February 11, 2021 17:51
Close Github Issues when the corresponding Project Card is moved to column "Done"
name: "Close issue"
on:
project_card:
types: [moved]
jobs:
close-issue:
name: "Close issue when card moves to Done column"
runs-on: ubuntu-latest
/* ... */
VStack(alignment: .leading, spacing: 2) {
Text(entry.product.name)
.bold()
.font(Font.system(size: 14))
Text("\(entry.product.formattedAmount(maskingData: entry.maskSensitiveData))")
.bold()
.lineLimit(1)
.font(Font.system(size: 22))
Spacer()
public func timeline(for configuration: MainAccountIntent, with context: Context, completion: @escaping (Timeline<Entry>) -> ()) {
let currentDate = Date()
let futureDate = Calendar.current.date(byAdding: .minute, value: 10, to: currentDate)!
viewModel.fetchProducts() { products in
guard let mainProduct = products.first(where: { $0.type == .main }) else { return }
let entry = AccountEntry(date: currentDate,
product: mainProduct,
maskSensitiveData: configuration.maskSensitiveData as? Bool ?? true)
struct SimpleEntry: TimelineEntry {
public let date: Date
public let product: Product
public let maskSensitiveData: Bool
}
struct Provider: IntentTimelineProvider {
public typealias Intent = MainAccountIntent
/* ... */
public func snapshot(for configuration: MainAccountIntent, with context: Context, completion: @escaping (AccountEntry) -> ()) {
/* Hidden implementation */
}
public func timeline(for configuration: MainAccountIntent, with context: Context, completion: @escaping (Timeline<Entry>) -> ()) {
/* Hidden implementation */
struct Provider: TimelineProvider {
public typealias Entry = AccountEntry
let viewModel = ViewModel()
public func snapshot(with context: Context, completion: @escaping (AccountEntry) -> ()) {
let entry = SimpleEntry(date: Date(), product: previewProduct, maskSensitiveData: false)
completion(entry)
}
@main
struct MainAccount: Widget {
private let kind: String = "MainAccount"
public var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: Provider(), placeholder: PlaceholderView()) { entry in
MainAccountEntryView(entry: entry)
}
.configurationDisplayName("Main Account")
.description("See information about your main account.")