Skip to content

Instantly share code, notes, and snippets.

View vcalfa's full-sized avatar

Vladimir Calfa vcalfa

  • Ringier Axel Springer Comunities s.r.o.
  • Zilina
View GitHub Profile
@gdavis
gdavis / xcode-vim.markdown
Last active November 1, 2024 23:31
Notes for working with Xcode VIM mode

Xcode VIM

Learning VIM in Xcode comes with its own set of challenges and limitations, but there is enough there for you to give your mousing hand a break and master the keyboard.

A limited set of commands are available in Xcode, and this document attempts help ease the learning curve of using VIM in Xcode by providing a handy reference as well as what I find works for me in practice.

NOTE: Commands are case-sensitive. A command of N means pressing shift + n on the keyboard.

This document is a work in progress! Leave a comment if you would like to see a change.

import Amplitude_iOS
import Foundation
import ReactiveSwift
import UIKit
public final class AmplitudeUserPropertiesUpdater {
private enum Constants {
static let keyPrefix = "remoteSettings"
static let applicationStateKey = "applicationState"
@sye8
sye8 / swift3SelfSignedSSLCert.md
Last active March 26, 2024 18:45
Swift 3 Trusting a Self-Signed SSL Certificate

Swift 3 Trusting a Self-Signed SSL Certificate

For testing purposes, we may want to have local testing servers using self-signed SSL certificate for HTTPS connection. Now, suppose we have a local server with self-signed certificate, establishing an actual HTTPS connection would require us to trust our self-signed certificate. It is easy on a browser: few clicks, and you will be on your way. But how about a Swift application?

Caution: Get an actual, trusted, signed certicate for production apps!

0. A regular HTTPS request

App Transport Security (ATS) is a technology that requires an app to either support best practice HTTPS security or statically declare its security limitations via a property in its Info.plist.

@banjun
banjun / ViewController.swift
Created November 3, 2017 03:43
list AVCaptureDevice including iOSScreenCaptureAssistant
import Cocoa
import CoreMediaIO
import AVFoundation
class ViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
var prop = CMIOObjectPropertyAddress(
mSelector: CMIOObjectPropertySelector(kCMIOHardwarePropertyAllowScreenCaptureDevices),
@lattner
lattner / TaskConcurrencyManifesto.md
Last active November 15, 2024 05:45
Swift Concurrency Manifesto
@OleksandrKucherenko
OleksandrKucherenko / version-up.sh
Last active August 15, 2024 07:28
Calculate Next Suitable Version Tag for Your Git based project
#!/usr/bin/env bash
# shellcheck disable=SC2155
## Copyright (C) 2017, Oleksandr Kucherenko
## Last revisit: 2023-09-30
## Version: 2.0.2
## License: MIT
## Fix: 2023-10-01, prefix for initial INIT_VERSION was not applied
## Fix: 2023-10-01, correct extraction of latest tag that match version pattern
## Added: 2023-09-30, @mrares prefix modification implemented
@tapi
tapi / UICollectionView+Registration.swift
Created April 4, 2016 16:38
Typed UITableView & UICollectionView Dequeuing in Swift
import UIKit
extension UICollectionReusableView {
/// The default implementation of `defaultIdentifier()` uses `NSStringFromClass(class)` rather than `String(class)` so that the module name is includded.
/// The hope being that this makes collisions unlikely making it unnnecessary to provide your own implementations.
public class func defaultIdentifier() -> String {
return NSStringFromClass(self)
}
}
@agrippa1994
agrippa1994 / playground.swift
Created January 4, 2016 22:05
Bonjour Discovery OS X iOS
import Foundation
import XCPlayground
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true
extension NSData {
func castToCPointer<T>() -> T {
let mem = UnsafeMutablePointer<T>.alloc(sizeof(T.Type))
self.getBytes(mem, length: sizeof(T.Type))
return mem.move()
@rajbharath
rajbharath / Postman UUID
Created June 26, 2015 13:11
How to create UUID in postman rest client
{{$guid}}
the above variable will generate UUID in Postman Rest Client
Sample request is below
========================
{
"user":{
"id":"{{$guid}}"
}
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active June 17, 2024 06:08
The best FRP iOS resources.

Videos