Skip to content

Instantly share code, notes, and snippets.

View JakfarShodiq's full-sized avatar
💫

Muhamad Jakfar Shodiq JakfarShodiq

💫
View GitHub Profile
@siswadi
siswadi / Waktu Sholat Arah Kiblat.md
Last active October 28, 2023 07:10
Waktu Sholat & Arah Kiblat w/ HTTP/JSON API

Waktu Sholat & Arah Kiblat

Informasi Waktu

https://time.sis.im/
https://time.sis.im/Asia/Jakarta
https://time.sis.im/help
https://time.sis.im/?help
https://time.sis.im/?timezone=Asia/Jakarta # rekomendasi
@examinedliving
examinedliving / cham.less
Last active December 24, 2017 15:35
Chameleon for IOS color scheme as less vars
// Color Scheme from [Chameleon](https://github.com/ViccAlexander/Chameleon) for IOS
@black-light:#545d63;
@black-dark:#262626;
@navy-light: #34495e;
@navy-dark: #2c3e50;
@sand-light: #f0deb4;
@sand-dark: #d5c295;
@yellow-light: #ffcd02;
@mminer
mminer / formatBytes.swift
Last active April 19, 2023 00:59
Formats bytes into a more human-readable form (e.g. MB).
import Foundation
func format(bytes: Double) -> String {
guard bytes > 0 else {
return "0 bytes"
}
// Adapted from http://stackoverflow.com/a/18650828
let suffixes = ["bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
let k: Double = 1000
@gonzalezreal
gonzalezreal / ios-cell-registration-swift.md
Last active March 13, 2024 15:18
iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

A common task when developing iOS apps is to register custom cell subclasses for both UITableView and UICollectionView. Well, that is if you don’t use Storyboards, of course.

Both UITableView and UICollectionView offer a similar API to register custom cell classes:

public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)