Skip to content

Instantly share code, notes, and snippets.


Eneko Alonso eneko

View GitHub Profile
oleganza /
Last active Jun 21, 2022
Concrete proposal for async semantics in Swift

Async semantics proposal for Swift

Modern Cocoa development involves a lot of asynchronous programming using blocks and NSOperations. A lot of APIs are exposing blocks and they are more natural to write a lot of logic, so we'll only focus on block-based APIs.

Block-based APIs are hard to use when number of operations grows and dependencies between them become more complicated. In this paper I introduce asynchronous semantics and Promise type to Swift language (borrowing ideas from design of throw-try-catch and optionals). Functions can opt-in to become async, programmer can compose complex logic involving asynchronous operations while compiler produces necessary closures to implement that logic. This proposal does not propose new runtime model, nor "actors" or "coroutines".

Table of contents

s-aska / Keychain.swift
Last active Sep 16, 2022
Swift Keychain class ( supported Xcode 6.0.1 )
View Keychain.swift
import UIKit
import Security
class Keychain {
class func save(key: String, data: NSData) -> Bool {
let query = [
kSecClass as String : kSecClassGenericPassword as String,
kSecAttrAccount as String : key,
kSecValueData as String : data ]
duemunk / Guilty
Last active Jun 23, 2016
Operator overload badge
View Guilty
<img src="" height="20" alt="Uses operator overloads"/>
rodneyrehm / gist:40e7946c0cff68a31cea
Last active May 14, 2022
Diagrams for Documentation
View gist:40e7946c0cff68a31cea

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices


View grouper_interactor_example.rb
class GroupersController < ApplicationController::Base
def create
@grouper = current_member)
redirect_to home_path
davidjrice / .travis.yml
Last active Oct 23, 2019 — forked from johanneswuerbach/.travis.yml
Travis CI + TestFlight integration (updated for Travis' new Mac VM setup / xctool)
View .travis.yml
language: objective-c
xcode_workspace: "<WorkspaceName.xcworkspace>"
xcode_scheme: "<SchemaName>"
script: xctool -workspace <WorkspaceName.xcworkspace> -scheme <SchemeName> -configuration Release build archive
- ./scripts/travis/
- ./scripts/travis/
- ./scripts/travis/
johanneswuerbach / .travis.yml
Last active Feb 3, 2022
Deploy an iOS app to testflight using Travis CI
View .travis.yml
language: objective-c
- ./scripts/travis/
- ./scripts/travis/
- ./scripts/travis/
jhjguxin / creating-nested-resources-in-ruby-on-rails-3-and-updating-scaffolding-links-and-redirection.markdown
Created Jul 9, 2012
Creating nested resources in ruby on rails 3 and updating scaffolding links and redirection
View creating-nested-resources-in-ruby-on-rails-3-and-updating-scaffolding-links-and-redirection.markdown
jobliz /
Created May 4, 2012
A short script exploring Redis pubsub functions in Python
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
self.redis = r
self.pubsub = self.redis.pubsub()
kirpit /
Last active May 17, 2022
Enables to run subprocess commands in a different thread with TIMEOUT option!
#! /usr/bin/env python
import threading
import subprocess
import traceback
import shlex
class Command(object):
Enables to run subprocess commands in a different thread with TIMEOUT option.