Skip to content

Instantly share code, notes, and snippets.

Avatar
💻

Eneko Alonso eneko

💻
View GitHub Profile
@Daniel-ltw
Daniel-ltw / from.yaml
Last active March 20, 2023 21:45
Github Actions repository_dispatch example
View from.yaml
name: Build Artifacts
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
@kirpit
kirpit / bash.py
Last active March 17, 2023 06:29
Enables to run subprocess commands in a different thread with TIMEOUT option!
View bash.py
#! /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.
View boilerplate.swift
// Run any SwiftUI view as a Mac app.
import Cocoa
import SwiftUI
NSApplication.shared.run {
VStack {
Text("Hello, World")
.padding()
.background(Capsule().fill(Color.blue))
@jobliz
jobliz / RedisPythonPubSub1.py
Created May 4, 2012 17:58
A short script exploring Redis pubsub functions in Python
View RedisPythonPubSub1.py
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
@lattner
lattner / async_swift_proposal.md
Last active February 10, 2023 16:19 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift
View async_swift_proposal.md

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

@smileyborg
smileyborg / InteractiveTransitionCollectionViewDeselection.m
Last active January 15, 2023 13:03
Animate table & collection view deselection alongside interactive transition (for iOS 11 and later)
View InteractiveTransitionCollectionViewDeselection.m
// UICollectionView Objective-C example
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
NSIndexPath *selectedIndexPath = [[self.collectionView indexPathsForSelectedItems] firstObject];
if (selectedIndexPath != nil) {
id<UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator;
if (coordinator != nil) {
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
@jhjguxin
jhjguxin / creating-nested-resources-in-ruby-on-rails-3-and-updating-scaffolding-links-and-redirection.markdown
Created July 9, 2012 03:32
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
@rodneyrehm
rodneyrehm / gist:40e7946c0cff68a31cea
Last active November 7, 2022 09:11
Diagrams for Documentation
View gist:40e7946c0cff68a31cea

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@johanneswuerbach
johanneswuerbach / .travis.yml
Last active October 7, 2022 21:30
Deploy an iOS app to testflight using Travis CI
View .travis.yml
---
language: objective-c
before_script:
- ./scripts/travis/add-key.sh
after_script:
- ./scripts/travis/remove-key.sh
after_success:
- ./scripts/travis/testflight.sh
env:
global:
@s-aska
s-aska / Keychain.swift
Last active September 16, 2022 03:37
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 ]