Skip to content

Instantly share code, notes, and snippets.

View JigneshPatel's full-sized avatar

Jignesh Fadadu JigneshPatel

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
@JigneshPatel
JigneshPatel / ios.settings.schemes.md
Created September 26, 2018 12:23 — forked from tzmartin/ios.settings.schemes.md
iOS Settings URL Scheme List

Settings URL schemes:

Note: < i=OS 5.1 use prefs:. > 5.1 use app-settings:

  • app-settings:root=General&path=About
  • app-settings:root=General&path=ACCESSIBILITY
  • app-settings:root=AIRPLANE_MODE
  • app-settings:root=General&path=AUTOLOCK
  • app-settings:root=General&path=USAGE/CELLULAR_USAGE
  • app-settings:root=Brightness
@JigneshPatel
JigneshPatel / contact.m
Created August 7, 2019 10:06 — forked from willthink/contact.m
Using CNContactStore in Objective C to query contacts info
#import <Contacts/Contacts.h>
@implementation ContactsScan
- (void) contactScan
{
if ([CNContactStore class]) {
//ios9 or later
CNEntityType entityType = CNEntityTypeContacts;
if( [CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusNotDetermined)
protocol Randomizer {
static func randomIv() -> Data
static func randomSalt() -> Data
static func randomData(length: Int) -> Data
}
protocol Crypter {
func encrypt(_ digest: Data) throws -> Data
func decrypt(_ encrypted: Data) throws -> Data
}
@JigneshPatel
JigneshPatel / AesCipher.java
Created January 8, 2020 06:58 — forked from demisang/AesCipher.java
AES/CBC/PKCS5Padding encrypt/decrypt PHP and JAVA example classes
import android.support.annotation.Nullable;
import android.util.Base64;
import java.nio.ByteBuffer;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
@JigneshPatel
JigneshPatel / UIImage+QR.swift
Created March 30, 2020 06:08 — forked from freak4pc/UIImage+QR.swift
Detect text messages from QR code
extension UIImage {
func parseQR() -> [String] {
guard let image = CIImage(image: self) else {
return []
}
let detector = CIDetector(ofType: CIDetectorTypeQRCode,
context: nil,
options: [CIDetectorAccuracy: CIDetectorAccuracyHigh])
@JigneshPatel
JigneshPatel / UIDevice+XMUtils.h
Created April 27, 2020 07:09 — forked from kangzubin/UIDevice+XMUtils.h
The sample code to get iPhone device name.
//
// UIDevice+XMUtils.h
// AwesomeTips
//
// Created by kangzubin on 2018/9/20.
// Copyright © 2018 KANGZUBIN. All rights reserved.
//
#import <UIKit/UIKit.h>
@JigneshPatel
JigneshPatel / QRCodeScanner.m
Created April 27, 2020 08:40 — forked from snej/QRCodeScanner.m
Snippet showing how to capture QR codes from the device camera on iOS or Mac OS X
- (BOOL) startCapture: (NSError**)outError {
if (!_session) {
_session = [[AVCaptureSession alloc] init];
AVCaptureDevice* video = [AVCaptureDevice defaultDeviceWithMediaType: AVMediaTypeVideo];
if (!video)
return [self failWithMessage: @"No video camera available" error: outError];
AVCaptureDeviceInput* input = [AVCaptureDeviceInput deviceInputWithDevice: video
error: outError];
if (!input)
return [self failWithMessage: @"Couldn't acquire input device" error: outError];
@JigneshPatel
JigneshPatel / UISearchBar.m
Created May 15, 2020 08:18 — forked from jeksys/UISearchBar.m
Detecting when clear is clicked in UISearchBar (X button)
- (void)viewDidLoad {
//find the UITextField view within searchBar (outlet to UISearchBar)
//and assign self as delegate
for (UIView *view in searchBar.subviews){
if ([view isKindOfClass: [UITextField class]]) {
UITextField *tf = (UITextField *)view;
tf.delegate = self;
break;
}
}
@JigneshPatel
JigneshPatel / us-states-array
Created August 26, 2020 09:59 — forked from iamjason/us-states-array
Swift US States Array
let state = [ "AK - Alaska",
"AL - Alabama",
"AR - Arkansas",
"AS - American Samoa",
"AZ - Arizona",
"CA - California",
"CO - Colorado",
"CT - Connecticut",
"DC - District of Columbia",
"DE - Delaware",