Skip to content

Instantly share code, notes, and snippets.

View jkmathew's full-sized avatar
🎯
Focusing

Johnykutty Mathew jkmathew

🎯
Focusing
View GitHub Profile
// A SceneKit based Playground to test camera position and movement
// using a camera orbit
import SceneKit
import PlaygroundSupport
// setup view
var sceneView = SCNView(frame: CGRect(x:0 , y:0, width: 480, height: 640))
var scene = SCNScene()
sceneView.scene = scene
@buntagonalprism
buntagonalprism / Dart Class.dart
Last active April 2, 2023 12:22
Flutter and Dart collection of file templates for Android Studio development
#set( $nameparts = $NAME.split("_"))
#set( $namepart = '')
#set( $classname = '')
#foreach( $namepart in $nameparts )
#set( $classname = $classname + $namepart.substring(0, 1).toUpperCase() + $namepart.substring(1))
#end
class $classname {
// TODO: add class properties and methods
@romanroibu
romanroibu / RSSFeed.swift
Last active April 9, 2021 15:28 — forked from kharrison/RSSFeed.swift
Swift Decodable With Multiple Custom Dates (https://useyourloaf.com/blog/swift-codable-with-custom-dates)
import Foundation
extension DateFormatter {
static let iso8601Full: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
formatter.calendar = Calendar(identifier: .iso8601)
formatter.timeZone = TimeZone(secondsFromGMT: 0)
formatter.locale = Locale(identifier: "en_US_POSIX")
return formatter
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 1, 2024 15:48
Swift Concurrency Manifesto
@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

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.

@ncerezo
ncerezo / FileUploader.swift
Last active November 30, 2022 03:17
Alamofire multipart upload
//
// FileUploader.swift
//
// Copyright (c) 2015 Narciso Cerezo Jiménez. All rights reserved.
// Largely based on this stackoverflow question: http://stackoverflow.com/questions/26121827/uploading-file-with-parameters-using-alamofire/28467829//
import Foundation
import Alamofire
private struct FileUploadInfo {
@pbock
pbock / buergerbot.rb
Last active April 22, 2024 10:58
Bürgerbot: Refreshes the Berlin Bürgeramt page until an appointment becomes available, then notifies you.
#!/usr/bin/env ruby
require 'watir-webdriver'
def log (message) puts " #{message}" end
def success (message) puts "+ #{message}" end
def fail (message) puts "- #{message}" end
def notify (message)
success message.upcase
system 'osascript -e \'Display notification "Bürgerbot" with title "%s"\'' % message
rescue StandardError => e
@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active May 2, 2024 22:51
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*