Skip to content

Instantly share code, notes, and snippets.

Alejandro Martínez alexito4

Block or report user

Report or block alexito4

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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")) {;
alexito4 / RemoteImage.swift
Last active Dec 31, 2019
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 / 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) }
let content = try! String(contentsOfFile: path)
let lines = content
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

Keybase proof

I hereby claim:

  • I am alexito4 on github.
  • I am 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 / 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)
alexito4 / Amazing.h
Last active Aug 29, 2015
Add XCTest at runtime
View Amazing.h
#import <Foundation/Foundation.h>
#import "Smiler.h"
@interface Amazing : NSObject <Smiler>
View main
local wait = 60
local city = "London,uk"
while true do
local commandBlock = peripheral.wrap("back")
local w = weather.getWeather(city)
alexito4 / gist:5be48be412d4aa44c60c
Created Aug 30, 2014
Understanding Value and Reference Types in Swift
View gist:5be48be412d4aa44c60c
// Understanding Value and Reference Types in Swift
One of the coolest parts about Swift is how powerful all the types are. Structs are not like basic C structs, they have a lot of similarities with classes, and the same goes for the Enums. This is really good but also comes with the risk that newcomers doesn't know the differences between them. The oficial Swift blog has a great post about [Value and Reference Types](, read it.
In this post/playground I want to go step by step in some cases that will help newcomers understand how the different types work in Swift. It's good for people that comes form Objective-C to understand how Swift still has pointers, but hidden behind the language to make it safe. And for the newcomers, that doesn't know much about programming or *pointers*, will be good to understand what's actually happening behind the scenes.
## Categorization
Swift has two categories of Types: Value and Reference.
You can’t perform that action at this time.