Skip to content

Instantly share code, notes, and snippets.

View felipericieri's full-sized avatar
:octocat:
Coding

Felipe Ricieri felipericieri

:octocat:
Coding
View GitHub Profile
@LemonSpike
LemonSpike / .lldbinit
Last active February 14, 2023 15:29
Xcode LLDB Snippets
command alias 🚽 expression -l objc -- (void)[CATransaction flush]
command alias porvc e -l swift -- UIApplication.shared.keyWindow?.rootViewController?.value(forKey: "_printHierarchy")
@dagronf
dagronf / synchronized.swift
Last active October 17, 2023 12:33
Swift method to provide the equivalent of `@synchronised` from objc
/// Provide the equivalent of @synchronised on objc
private func synchronized<T>(_ lock: AnyObject, _ body: () throws -> T) rethrows -> T {
objc_sync_enter(lock)
defer { objc_sync_exit(lock) }
return try body()
}
/// Simple lockable class
class Lockable {
private var lockable: AnyObject
@vikaskore
vikaskore / RecordAudioViewController.swift
Last active April 30, 2024 11:05
Record and Play audio in iOS Swift
//
// RecordAudioViewController.swift
// Samples
//
// Created by VikasK on 11/02/19.
// Copyright © 2019 Vikaskore Software. All rights reserved.
//
import UIKit
import AVFoundation
@kishikawakatsumi
kishikawakatsumi / UIScrollView+UIPageControl.swift
Created April 29, 2018 15:21
UIScrollView + UIPageControl with RxSwift
import RxSwift
import RxCocoa
fileprivate extension Reactive where Base: UIScrollView {
fileprivate var currentPage: Observable<Int> {
return didEndDecelerating.map({
let pageWidth = self.base.frame.width
let page = floor((self.base.contentOffset.x - pageWidth / 2) / pageWidth) + 1
return Int(page)
})
@maiconhellmann
maiconhellmann / UnsafeOkHttpClient.kt
Last active May 1, 2024 14:12
UnsafeHttpClient wrote in Kotlin
import android.annotation.SuppressLint
import okhttp3.OkHttpClient
import java.security.cert.CertificateException
import javax.net.ssl.SSLContext
import javax.net.ssl.TrustManager
import javax.net.ssl.X509TrustManager
object UnsafeOkHttpClient {
fun Builder(): OkHttpClient.Builder {
try {
@dedecej
dedecej / arc.swift
Created October 6, 2017 08:58
Reference counting demo
import Foundation
// Retain count of object
var object = NSObject()
CFGetRetainCount(object)
let nextObject = object
@gkaemmer
gkaemmer / Elixir_Supervision_Trees.md
Last active December 18, 2023 14:37
Quick guide to creating Elixir supervision trees from scratch

Elixir Supervision Trees Made Easy

I started with Elixir just a couple weeks after the switch from 1.4 to 1.5, so the bulk of online resources were out of date (or at least resulted in deprecation warnings). This guide is for defining Elixir 1.5 supervised modules.

It's not actually terribly complicated. It's just sometimes unclear from examples what's implemented by the language and what you actually have to implement yourself.

Say we want a supervision tree like this (where each atom is a process):

    :a

/ \

@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 7, 2024 09:05
Swift Concurrency Manifesto
@dautermann
dautermann / UIImage+Colorize.swift
Last active August 30, 2018 13:08 — forked from fabb/UIImage+Colorize.swift
Colorize / tint a UIImage (Swift 3 compatible)
import UIKit
extension UIImage {
// colorize image with given tint color
// this is similar to Photoshop's "Color" layer blend mode
// this is perfect for non-greyscale source images, and images that have both highlights and shadows that should be preserved
// white will stay white and black will stay black as the lightness of the image is preserved
func tint(tintColor: UIColor) -> UIImage? {
@skreutzberger
skreutzberger / sen_swiftbe_dev.md
Last active December 2, 2019 15:07
Senior Swift Backend Developer (Freelance, 100% Remote)

Senior Swift Backend Developer (Freelance, 100% Remote)

I am searching experienced backend developers (freelance, remote) with a ❤️ for Swift for Moonshot Energy, the world’s first AI-driven renewable energy company located in Germany. Moonshot Energy is financially backed by Innogy SE, one of Europe's largest energy providers.

At Moonshot you will play a major role in making the world greener, the future brighter and energy distribution smarter by using latest technologies like server-side Swift, microservices, artificial intelligence 🤖 and machine learning and new interfaces like chatbots and dialog-based systems (NLP).

Since our team is working on European timezones it would be good if you would live in the EU or if you are an early bird living in US-East 🇪🇺🇺🇸.

Your job:

  • build our internal microservices