Skip to content

Instantly share code, notes, and snippets.

View ShabanKamell's full-sized avatar
🏠
Working from home

Shaban Kamel ShabanKamell

🏠
Working from home
View GitHub Profile
@jacobbubu
jacobbubu / ioslocaleidentifiers.csv
Created February 15, 2012 14:41
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@mlagerberg
mlagerberg / DottedLine.java
Last active February 20, 2021 11:04
[Vertical dotted line view] #android
package com.pixplicity.gist.ui.views;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathDashPathEffect;
import android.util.AttributeSet;
@andreif
andreif / AppDelegate.swift
Created March 16, 2016 22:15
Example of UIPageViewController without storyboard i.e. created programmatically
// derived from https://www.veasoftware.com/posts/uipageviewcontroller-in-swift-xcode-62-ios-82-tutorial
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController()
public extension Int {
public var seconds: DispatchTimeInterval {
return DispatchTimeInterval.seconds(self)
}
public var second: DispatchTimeInterval {
return seconds
}
@tadija
tadija / FontNames-iOS-17.4.swift
Last active April 30, 2024 00:30
iOS - All Font Names
/*
*** Academy Engraved LET ***
AcademyEngravedLetPlain
---------------------
*** Al Nile ***
AlNile
AlNile-Bold
---------------------
*** American Typewriter ***
AmericanTypewriter
// MARK: - Regular Expression
private extension String {
func regexp(_ pattern: String) -> NSRegularExpression {
do {
let regexp: NSRegularExpression = try NSRegularExpression(pattern: pattern, options: [NSRegularExpression.Options.caseInsensitive])
return regexp
} catch {
fatalError("regular expression pattern is invalid.")
}
}
@danielt1263
danielt1263 / RetryingTokenNetworkService.swift
Last active June 12, 2023 14:54
The TokenAcquisitionService automatically retry requests if it receives an unauthorized error. Complete with proof that it works correctly.
//
// TokenAcquisitionService.swift
//
// Created by Daniel Tartaglia on 16 Jan 2019.
// Copyright © 2022 Daniel Tartaglia. MIT License.
//
import Foundation
import RxSwift
@arturdev
arturdev / URLRequest+Multipart.swift
Last active February 21, 2023 18:59
URLRequest with multipart support
//
// URLRequest+Multipart.swift
//
// Created by Artur Mkrtchyan on 1/16/19.
// Copyright © 2019 arturdev. All rights reserved.
//
import Foundation
import MobileCoreServices
@ErikHellman
ErikHellman / LoginScreenWithCompose.kt
Created December 16, 2019 17:51
A simple demo of using Jetpack Compose to build a Login screen
package se.hellsoft.jetpackcomposeintro
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.Composable
import androidx.compose.Model
import androidx.compose.state
import androidx.compose.unaryPlus
import androidx.ui.core.*
import androidx.ui.foundation.shape.border.Border
@trilliwon
trilliwon / How to turn off the shutter sound when capture? AVFoundation.swift
Created December 21, 2019 05:08
How to turn off the shutter sound when capture? AVFoundation
class PhotoCapture {
// here some stuff for capture image, such as capture session, configurations, photo output
// More detail : https://github.com/trilliwon/ArtCamera/blob/master/Camera/Controllers/PhotoCapture.swift
}
// MARK: - AVCapturePhotoCaptureDelegate
extension PhotoCapture: AVCapturePhotoCaptureDelegate {
func photoOutput(_ output: AVCapturePhotoOutput, willCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings) {
AudioServicesDisposeSystemSoundID(1108)
}