Skip to content

Instantly share code, notes, and snippets.

View knottx's full-sized avatar
:octocat:

Visarut Tippun knottx

:octocat:
View GitHub Profile
@knottx
knottx / country_dial_code.json
Last active February 10, 2025 11:08
country_codes.json
[
{
"name": "United States",
"dialCode": "+1",
"emoji": "🇺🇸",
"countryCode": "US",
"pattern": "(###) ###-####"
},
{
"name": "Canada",
@knottx
knottx / ExtendedDotView.swift
Created August 18, 2021 17:11
ExtendedDotView
import UIKit
class ExtendedDotView: UIView {
var animDuration = 0.2
private var mustGoCurrentItem: CGFloat = 0
private var previuscurrentItem: CGFloat = 0
private var displayLink: CADisplayLink?
private var startTime = 0.0
@knottx
knottx / cURL.swift
Last active May 20, 2021 08:45
Extension URLRequest cURL
import Foundation
extension URLRequest {
/// Returns a cURL command for a request
/// - return A String object that contains cURL command or "" if an URL is not properly initalized.
public var cURL: String {
guard let url = url,
let httpMethod = httpMethod,
!url.absoluteString.utf8.isEmpty else { return "" }