Skip to content

Instantly share code, notes, and snippets.

@okiookio
okiookio / ProgressHUD.swift
Created March 9, 2023 02:36
showProgressHUD / dismissProgressHUD
import UIKit
//-----------------------------------------------------------------------------------------------------------------------------------------------
public extension ProgressHUD {
enum AnimationType {
case systemActivityIndicator
case horizontalCirclesPulse
case lineScaling
case singleCirclePulse
@okiookio
okiookio / FileWebService.swift
Created March 5, 2023 13:36 — forked from boboboa32/FileWebService.swift
Moya file download
import Moya
import SwiftyJSON
enum FileWebService {
case download(url: String, fileName: String?)
var localLocation: URL {
switch self {
case .download(let url, let fileName):
let fileKey: String = url.MD5 // use url's md5 as local file name
@okiookio
okiookio / default_key_value_storage.dart
Created July 30, 2022 07:12
A Sample of Shared Preferences và Security Storage in real project.
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
/// Base class containing a unified API for key-value pairs' storage.
/// This class provides low level methods for storing:
/// - Sensitive keys using [FlutterSecureStorage]
/// - Insensitive keys using [SharedPreferences]
cd "C:\Program Files\Oracle\VirtualBox\"
VBoxManage.exe modifyvm "Your Virtual Machine Name" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "Your Virtual Machine Name" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
VBoxManage modifyvm "Your Virtual Machine Name" --cpu-profile "Intel Core i7-6700K"
@okiookio
okiookio / test1.swift
Created November 28, 2018 10:26
Test 1
import Foundation
struct SearchImageParam: Codable {
var size : String?
var mimeTypes: String?
var format: String?
var order: String?
var limit: Int?
var page: Int?
var categoryIds: String?