Skip to content

Instantly share code, notes, and snippets.

View phucledien's full-sized avatar
🇻🇳
Xin chào

Le Dien Phuc phucledien

🇻🇳
Xin chào
View GitHub Profile
@phucledien
phucledien / paddle-revenue.js
Created September 7, 2022 17:16 — forked from trungdq88/paddle-revenue.js
A scriptable's script to get Paddle revenue from multiple accounts using puppeteer.
/*
RUN THE SCRIPT BY YOURSELF:
- Run `node paddle-revenue.js` on your server and let it run 24/7.
- Access the API at http://your_server_ip:8175/ (JSON)
HOSTED VERSION:
If you don't want to run the script by your own, you can use the
hosted version. The price is $5 per month per Paddle account.
Here is how:
@phucledien
phucledien / Best in Class iOS Checklist
Created June 1, 2021 05:02 — forked from DreamingInBinary/Best in Class iOS Checklist
This is a public checklist updated every year after the latest version of iOS and iPadOS are shipped. It's a boiled down version of a "Best in Class" app checklist created by Jordan Morgan.
# A Best in Class Checklist
A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), created by @jordanmorgan10.
> To use this, create a Github Issue in your own repo, and simply copy and paste this text.
## iOS Core Technology
_Things any iOS app can benefit from_
- [ ] iCloud Sync
- [ ] [Core Spotlight integration](https://github.com/DreamingInBinary/Spend-Stack/issues/120)
@phucledien
phucledien / MinimalPromise.swift
Created March 9, 2021 07:28 — forked from fmo91/MinimalPromise.swift
The minimum viable promise in Swift
import Foundation
struct Promise<T> {
typealias ResultType = Result<T, Error>
typealias ResultObserver = (ResultType) -> Void
typealias CreatorFunction = (@escaping ResultObserver) -> Void
private let creatorFunction: CreatorFunction
init(creatorFunction: @escaping CreatorFunction) {
self.creatorFunction = creatorFunction
@phucledien
phucledien / struct_vs_inheritance.swift
Created January 21, 2021 17:52 — forked from AliSoftware/struct_vs_inheritance.swift
Swift, Struct & Inheritance: How to balance the will of using Struct & Value Types and the need for Inheritance?
// #!Swift-1.1
import Foundation
// MARK: - (1) classes
// Solution 1:
// - Use classes instead of struct
// Issue: Violate the concept of moving model to the value layer
// http://realm.io/news/andy-matuschak-controlling-complexity/
@phucledien
phucledien / libdispatch-efficiency-tips.md
Created November 25, 2020 04:59 — forked from tclementdev/libdispatch-efficiency-tips.md
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

@phucledien
phucledien / react-rendering.md
Last active November 8, 2020 17:46 — forked from tuhuynh27/react-rendering.md
A (Mostly) Complete Guide to React Rendering Behavior

Translated from https://blog.isquaredsoftware.com/2020/05/blogged-answers-a-mostly-complete-guide-to-react-rendering-behavior/, author: Mark Erikson (from Redux team)

A (Mostly) Complete Guide to React Rendering Behavior

Bài viết cung cấp chi tiết về cách mà React render hoạt động, và việc sử dụng Context và Redux ảnh hưởng thế nào tới quá trình render của React.

"Render" là gì

Rendering is the process of React asking your components to describe what they want their section of the UI to look like, now, based on the current combination of props and state.

@phucledien
phucledien / SidebarViewController.swift
Created November 6, 2020 03:53 — forked from wozuo/SidebarViewController.swift
Programmatically create NSTableView in Swift 4.1
import Cocoa
class SidebarViewController: NSViewController, NSTableViewDelegate, NSTableViewDataSource {
var initialized = false
let scrollView = NSScrollView()
let tableView = NSTableView()
override func loadView() {
self.view = NSView()
@phucledien
phucledien / ios-interview-resources.md
Created October 9, 2020 07:08 — forked from funmia/ios-interview-resources.md
General iOS, CS questions and interview prep resources.
@phucledien
phucledien / SwiftElmFrameworkList.md
Created August 9, 2020 16:50 — forked from inamiy/SwiftElmFrameworkList.md
React & Elm inspired frameworks in Swift
@phucledien
phucledien / DisplayLink.swift
Created August 9, 2020 16:21 — forked from CanTheAlmighty/DisplayLink.swift
DisplayLink for OSX