Skip to content

Instantly share code, notes, and snippets.

View hardikamal's full-sized avatar
🖥️

Hardik Amal hardikamal

🖥️
View GitHub Profile
@lalkrishna
lalkrishna / UIStoryboard+Extensions.swift
Created August 15, 2020 17:23
UIStoryboard Extension for Easy Instantiate Viewcontrollers [Swift]
enum Storyboard: String {
case main = "Main",
onboarding = "Onboarding"
}
protocol Instantiatable {
static var storyboard: Storyboard { get }
static func instantiate() -> Self
}
@bradtraversy
bradtraversy / mongodb_cheat_sheet.md
Last active November 17, 2024 10:01
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active November 16, 2024 20:24
crack activate Office on mac with license file
@NeilsUltimateLab
NeilsUltimateLab / SelectionTableCell.swift
Last active October 14, 2021 07:10
SelectionViewController with multiple and single selection.
import UIKit
class SelectionTableCell: UITableViewCell {
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.selectionStyle = .none
}
required init?(coder aDecoder: NSCoder) {

Note

Apple will reject apps that are using private url schemes (Ugh, Apple....) if they are pretty much obvius. Some apps are rejected and others are not, so, be aware of this issue before implementing any of those URL's in your app as a feature.

Updates

  • [UPDATE 4] iOS 10 update: apparently settings now can be reached using App-Pref instead of prefs
  • [UPDATE 3] For now you just can use url schemes to open your apps's settings with Swift 3.0 (Xcode 8). I'll keep you informed when OS preferences can be reached
  • [UPDATE 2] The openURL() method of UIApplication is now deprecated. You should use application(_:open:options:) instead
  • [UPDATE 1] Not yet tested in iOS 10. It will fail because of policies changes in URL scheme handling.
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active November 15, 2024 13:32
React Native Bridging Cheatsheet
public class BackgroundVideoRecorder extends Service implements SurfaceHolder.Callback {
private WindowManager windowManager;
private SurfaceView surfaceView;
private Camera camera = null;
private MediaRecorder mediaRecorder = null;
@Override
public void onCreate() {
@fahied
fahied / MyWKWebVC.Swift
Created January 10, 2017 06:46
WKWebView controller example with progress bar
//
// MyWKWebVC.Swift
// Example
//
// Created by Fahied on 04/01/2017.
//
import Foundation
import UIKit
import WebKit
@john1jan
john1jan / PrefKeys.java
Last active February 16, 2022 23:45
Utils class for storing and retrieving data from SharedPreference in Android
/**
* Created by john.francis on 24/05/16.
*/
public class PrefKeys {
public static final String USER_INCOME = "USER_INCOME";
public static final String USER_MARITAL_STATUS = "USER_MARITAL_STATUS";
public static final String USER_SALARY_FLOAT= "USER_SALARY_FLOAT";
public static final String USER_SALARY_LONG= "USER_SALARY_LONG";
public static final String USER_AGE= "USER_AGE";
}
@algal
algal / PKCS12.swift
Last active March 21, 2024 07:13
Reading PKCS12 with Swift in Foundation
// xcode 7.3
import Foundation
/**
Struct representing values returned by `SecPKCS12Import` from the Security framework.
This is what Cocoa and CocoaTouch can tell you about a PKCS12 file.
*/