Skip to content

Instantly share code, notes, and snippets.

Avatar

Alejandro Martínez alexito4

View GitHub Profile
@alexito4
alexito4 / AutoMockable.stencil
Created Aug 4, 2020
Sourcery templates for automatic mocks from a concrete type
View AutoMockable.stencil
// swiftlint:disable line_length
// swiftlint:disable variable_name
import Foundation
#if os(iOS) || os(tvOS) || os(watchOS)
import UIKit
#elseif os(OSX)
import AppKit
#endif
import RxSwift
View keybase.md

Keybase proof

I hereby claim:

  • I am alexito4 on github.
  • I am alejandromp (https://keybase.io/alejandromp) on keybase.
  • I have a public key ASBeRlhREhfheuUvVgFu8p0uvh_gwMzlE74WIJ7jk_wRtwo

To claim this, I am signing this object:

View gist:42488bfcf5385467c758633e389eb62f
import SwiftUI
import Combine
struct Object: Identifiable {
var id: String { name }
let name: String
}
final class Data: ObservableObject {
@alexito4
alexito4 / markAllFilesAsViewed.js
Created Oct 15, 2019
GitHub PR Mark ALL files as viewed
View markAllFilesAsViewed.js
for (const checkbox of document.querySelectorAll('.js-reviewed-checkbox')) {
if (checkbox.attributes["data-ga-click"].value.includes("value:false")) {
checkbox.click();
}
}
@alexito4
alexito4 / RemoteImage.swift
Last active Aug 19, 2020
Rough sketch of SwiftUI RemoteImage using AlamofireImage
View RemoteImage.swift
import SwiftUI
import Combine
import AlamofireImage
let imageDownloader = ImageDownloader(
configuration: ImageDownloader.defaultURLSessionConfiguration(),
downloadPrioritization: .fifo,
maximumActiveDownloads: 4,
imageCache: AutoPurgingImageCache()
)
@alexito4
alexito4 / lists.swift
Last active May 8, 2019
Swift script to convert Reminders export files (.ics) to lists.
View lists.swift
#!/usr/bin/swift sh
import Foundation
guard let path = CommandLine.arguments.dropFirst().first else { exit(1) }
print(path)
let content = try! String(contentsOfFile: path)
let lines = content
@alexito4
alexito4 / sessionslist.txt
Created Jun 6, 2018
WWDC 18 List of Sessions
View sessionslist.txt
What's New in Swift
Creating Apps for a Global Audience
Introducing Podcast Analytics
What's New in Cocoa Touch
Using Accelerate and simd
Live Screen Broadcast with ReplayKit
I Have This Idea For An App...
Automatic Strong Passwords and Security Code AutoFill
Measuring and Optimizing HLS Performance
What’s New in ARKit 2
View keybase.md

Keybase proof

I hereby claim:

  • I am alexito4 on github.
  • I am alejandromp (https://keybase.io/alejandromp) on keybase.
  • I have a public key whose fingerprint is F281 C10D C3E7 50B6 E256 ABCC DB9D C4B2 043A 15C9

To claim this, I am signing this object:

@alexito4
alexito4 / hang.swift
Last active Sep 4, 2015
Is this not valid in Swift? Tried on Xcode 7b6
View hang.swift
protocol Stack {
typealias Element
mutating func push(value: Element)
mutating func pop() -> Element?
}
struct ArrayStack<T>: Stack {
....
View srly.rb
require 'nokogiri-plist'
require 'uri'
class SRLItem
attr_accessor :title
attr_accessor :url
attr_accessor :source
def initialize(dict)
You can’t perform that action at this time.