Skip to content

Instantly share code, notes, and snippets.

Fabrizio Caldarelli FabrizioCaldarelli

Block or report user

Report or block FabrizioCaldarelli

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
FabrizioCaldarelli / ExpoIconSelector.js
Created Aug 17, 2019
Expo Icon Selector for React Native
View ExpoIconSelector.js
import React from "react";
import { View } from "react-native";
import { AntDesign, Entypo, EvilIcons, Feather, FontAwesome, FontAwesome5, Foundation, Ionicons, MaterialCommunityIcons, MaterialIcons, Octicons, SimpleLineIcons, Zocial } from '@expo/vector-icons';
export default class ExpoIconSelector extends React.Component {
render() {
return (
View ItemSearch.php
class ItemSearch
public $dataoraAttraccoLocalized;
public $dataoraRipartenzaLocalized;
public function rules()
return [
[['dataoraAttraccoLocalized', 'dataoraRipartenzaLocalized', 'dataora_attracco', 'dataora_ripartenza', 'dataora_inserimento'], 'safe'],
View date-trait-query.php
class DateTraitQuery
public function andWhereDate($attribute, $value, $separators = ['/','-'])
$array = null;
foreach($separators as $separator)
if(strpos($value, $separator) !== false) $array = explode($separator, $value);
View ios-wkwebview-cookies.m
- (void)initWebView
// add session cookie to ajax calls
WKUserContentController* userContentController =;
WKUserScript * cookieScript =
[[WKUserScript alloc]
initWithSource: [[User sharedInstance] getJavscriptCookieString]
injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO];

1. Create a script and place in /etc/init.d (e.g /etc/init.d/myscript). The script should have the following format:

# chkconfig: 2345 20 80
# description: Description comes here....

# Source function library.
. /etc/init.d/functions
View keychain-with-touch-id.swift
// 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,
View uitextfield-with-date-picker.swift
// Inizializza il selettore della data di nascita
dateBirthDatePicker = UIDatePicker()
dateBirthDatePicker?.datePickerMode = .date
txtDateBirth.inputView = dateBirthDatePicker
let dateBirthAccessory = UIToolbar()
dateBirthAccessory.items = [ UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(onDateBirthDateBtnDoneTapped)) ]
txtDateBirth.inputAccessoryView = dateBirthAccessory
FabrizioCaldarelli / .htaccess
Created Mar 13, 2019
Add this entry to avoid that Apache truncates Authorization header
View .htaccess
<IfModule mod_setenvif.c>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
View Plesk forward traffic through
iptables -t nat -A POSTROUTING -s -j SNAT --to
echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf
sysctl --system
FabrizioCaldarelli / UIImageView-SFmobile.swift
Created Dec 17, 2018
UIImageView tint not change from xib
View UIImageView-SFmobile.swift
import UIKit
// fixing Bug in XCode
extension UIImageView {
override open func awakeFromNib() {
You can’t perform that action at this time.