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
@masuhara
masuhara / RainbowGradient.swift
Last active May 6, 2018 20:33
Rainbow color gradient written in Swift2.2
func insertGradientLayer(view: UIView) {
let color1 = UIColor.redColor()
let color2 = UIColor(red: 255, green: 165, blue: 0, alpha: 1.0)
let color3 = UIColor.yellowColor()
let color4 = UIColor(red: 0, green: 128, blue: 0, alpha: 1.0)
let color5 = UIColor.cyanColor()
let color6 = UIColor.blueColor()
let color7 = UIColor.purpleColor()
let fromColors = [color1.CGColor, color2.CGColor, color3.CGColor, color4.CGColor, color5.CGColor, color6.CGColor, color7.CGColor]
let toColors = fromColors.reverse()
@khanlou
khanlou / Fonts.swift
Created October 6, 2016 21:10
Print all fonts in Swift 3
UIFont.familyNames.forEach({ familyName in
let fontNames = UIFont.fontNames(forFamilyName: familyName)
print(familyName, fontNames)
})
@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
@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? {
@lattner
lattner / TaskConcurrencyManifesto.md
Last active June 8, 2024 03:41
Swift Concurrency Manifesto
@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

/ \

@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
@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 {
@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)
})
@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