Skip to content

Instantly share code, notes, and snippets.

View dlsolution's full-sized avatar
🏠

Linh Vo dlsolution

🏠
View GitHub Profile
@dlsolution
dlsolution / docker-compose.yml
Created October 15, 2023 07:54
Docker Persistent Stack
version: "3.9"
services:
mysql:
container_name: mysql
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: car_rental
@dlsolution
dlsolution / The Technical Interview Cheat Sheet.md
Last active June 29, 2021 10:42 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!

The below is just for some preservation for those who stumble across here, but is no longer kept up to date.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth.

Contributing

//
// CenteredCollectionViewFlowLayout.swift
// CenteredCollectionView
//
// Created by Benjamin Emdon on 2016-09-05.
// Copyright © 2016 Benjamin Emdon.
//
import UIKit
@dlsolution
dlsolution / ios-interview-resources.md
Created April 23, 2021 03:24 — forked from funmia/ios-interview-resources.md
General iOS, CS questions and interview prep resources.
// https://medium.com/@samermurad555/ios-provisional-notifications-eeb3832836fc
import UserNotifications
import UIKit
typealias GrantCb = (_ didGrant: Bool) -> Void
// Manages Notifications Permissions
class NotificationManager {
static let instance = NotificationManager()
@dlsolution
dlsolution / WWDC18-416.md
Created April 11, 2021 09:45 — forked from SheldonWangRJT/WWDC18-416.md
WWDC18 Notes by Sheldon - Session 416 - iOS Memory Deep Dive

WWDC18 Notes - Session 416 - iOS Memory Deep Dive

All session list link: Here
Session Link: Here
Demo starts @ 25:30 in the video.
Download session slides: Here

This notes is written by Sheldon after watching WWDC18 session 416. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.

@dlsolution
dlsolution / PerformanceTips.md
Last active March 23, 2021 03:57
Kingfisher Performance Tips

Performance Tips

Cancelling unnecessary downloading tasks

Once a downloading task initialized, even when you set another URL to the image view, that task will continue until finishes.

imageView.kf.setImage(with: url1) { result in 
 // `result` is `.failure(.imageSettingError(.notCurrentSourceTask))`
@dlsolution
dlsolution / FastScrollingCollectionView.md
Created March 23, 2021 03:52
UICollectionView with optimized smooth scrolling and improved performance. I expect that you use this when you want to add UICollectionView displaying images to your app.

FastScrollingCollectionView

UICollectionView with optimized smooth scrolling and improved performance.

I expect that you use this when you want to add UICollectionView displaying images to your app.

Tips

1. Cache image

We can use SDWebImage. Standing on the shoulders of giants.

@dlsolution
dlsolution / async_swift_proposal.md
Created January 21, 2021 15:34 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async semantics proposal for Swift

Modern Cocoa development involves a lot of asynchronous programming using blocks and NSOperations. A lot of APIs are exposing blocks and they are more natural to write a lot of logic, so we'll only focus on block-based APIs.

Block-based APIs are hard to use when number of operations grows and dependencies between them become more complicated. In this paper I introduce asynchronous semantics and Promise type to Swift language (borrowing ideas from design of throw-try-catch and optionals). Functions can opt-in to become async, programmer can compose complex logic involving asynchronous operations while compiler produces necessary closures to implement that logic. This proposal does not propose new runtime model, nor "actors" or "coroutines".

Table of contents