1. Create a script and place in /etc/init.d (e.g /etc/init.d/myscript). The script should have the following format:
#!/bin/bash
# chkconfig: 2345 20 80
# description: Description comes here....
# Source function library.
. /etc/init.d/functions
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) |
import UIKit | |
// fixing Bug in XCode | |
// http://openradar.appspot.com/18448072 | |
extension UIImageView { | |
override open func awakeFromNib() { | |
super.awakeFromNib() | |
self.tintColorDidChange() | |
} | |
} |
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 |
<IfModule mod_setenvif.c> | |
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 | |
</IfModule> |
// 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 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, |
<?php | |
class DateTraitQuery | |
{ | |
public function andWhereDate($attribute, $value, $separators = ['/','-']) | |
{ | |
$array = null; | |
foreach($separators as $separator) | |
{ | |
if(strpos($value, $separator) !== false) $array = explode($separator, $value); |
class ItemSearch | |
{ | |
public $dataoraAttraccoLocalized; | |
public $dataoraRipartenzaLocalized; | |
public function rules() | |
{ | |
return [ | |
[['dataoraAttraccoLocalized', 'dataoraRipartenzaLocalized', 'dataora_attracco', 'dataora_ripartenza', 'dataora_inserimento'], 'safe'], |