This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This two values identify the entry, together they become the | |
// primary key in the database | |
let myAttrService = "app_name" | |
let myAttrAccount = "first_name" | |
// DELETE keychain item (if present from previous run) | |
let delete_query: NSDictionary = [ | |
kSecClass: kSecClassGenericPassword, | |
kSecAttrService: myAttrService, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inizializza il selettore della data di nascita | |
dateBirthDatePicker = UIDatePicker() | |
dateBirthDatePicker?.datePickerMode = .date | |
txtDateBirth.inputView = dateBirthDatePicker | |
let dateBirthAccessory = UIToolbar() | |
dateBirthAccessory.sizeToFit() | |
dateBirthAccessory.items = [ UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(onDateBirthDateBtnDoneTapped)) ] | |
txtDateBirth.inputAccessoryView = dateBirthAccessory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_setenvif.c> | |
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 | |
</IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iptables -t nat -A POSTROUTING -s 172.16.0.0/24 -j SNAT --to 1.2.3.4 | |
echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf | |
sysctl --system |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
// fixing Bug in XCode | |
// http://openradar.appspot.com/18448072 | |
extension UIImageView { | |
override open func awakeFromNib() { | |
super.awakeFromNib() | |
self.tintColorDidChange() | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
@IBDesignable | |
class MyButton: UIButton { | |
// Connect the custom button to the custom class | |
@IBOutlet weak var view: UIButton! | |
override init(frame: CGRect) { | |
super.init(frame: frame) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package myapp; | |
import java.io.IOException; | |
import java.nio.charset.Charset; | |
import okhttp3.Headers; | |
import okhttp3.Interceptor; | |
import okhttp3.MediaType; | |
import okhttp3.Request; | |
import okhttp3.Response; | |
import okhttp3.ResponseBody; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Directory "/path-to-protected"> | |
AuthType Basic | |
AuthName "auth" | |
AuthUserFile "/auth-user-file-path" | |
require valid-user | |
SetEnvIf Request_URI "path-to-allow" allowed_restricted | |
Order allow,deny |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typealias IMG_VIEW_REQUESTS_TYPE = [ UIImageView : [String] ] | |
private struct AssociatedKey { | |
static var imgViewRequests = "imageCache_imgViewRequests" | |
} | |
var imgViewRequests : IMG_VIEW_REQUESTS_TYPE { | |
get { | |
return objc_getAssociatedObject(self, &AssociatedKey.imgViewRequests) as! SmartSingleton.IMG_VIEW_REQUESTS_TYPE | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<paths xmlns:android="http://schemas.android.com/apk/res/android"> | |
<external-path name="external_files" path="."/> | |
</paths> |