Skip to content

Instantly share code, notes, and snippets.

View igroomgrim's full-sized avatar
🥶
Focusing

Anak Mirasing igroomgrim

🥶
Focusing
View GitHub Profile
@igroomgrim
igroomgrim / ScrollingStackView.swift
Created February 15, 2021 02:19 — forked from SintraWorks/ScrollingStackView.swift
A scrolling capable drop-in replacement for UIStackView.
//
// ScrollingStackView.swift
//
// Created by Antonio Nunes on 05/08/2018.
// Copyright © 2018 SintraWorks. All rights reserved.
//
// 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
@igroomgrim
igroomgrim / publickey-git-error.markdown
Created November 4, 2020 04:15 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
@igroomgrim
igroomgrim / DataObjects.swift
Created March 11, 2020 15:04 — forked from DagAgren/DataObjects.swift
Receiving web push notifications on iOS, using the toot-relay forwarder
import Foundation
struct PushNotification: Codable {
let accessToken: String
let preferredLocale: String
let notificationId: Int64
let notificationType: Type
let icon: URL
let title: String
let body: String

Videos

######################
# Options
######################
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"

Thoughts on Swift 2 Errors

When Swift was first announced, I was gratified to see that one of the (few) philosophies that it shared with Objective-C was that exceptions should not be used for control flow, only for highlighting fatal programming errors at development time.

So it came as a surprise to me when Swift 2 brought (What appeared to be) traditional exception handling to the language.

Similarly surprised were the functional Swift programmers, who had put their faith in the Haskell-style approach to error handling, where every function returns an enum (or monad, if you like) containing either a valid result or an error. This seemed like a natural fit for Swift, so why did Apple instead opt for a solution originally designed for clumsy imperative languages?

I'm going to cover three things in this post:

@igroomgrim
igroomgrim / introrx.md
Created April 5, 2016 11:39 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing