Skip to content

Instantly share code, notes, and snippets.

View andrealufino's full-sized avatar
🌱

Andrea Mario Lufino andrealufino

🌱
View GitHub Profile
PATH=$PATH:/opt/homebrew/bin
# This script recognize the most recent xcresult file and copy to the clipboard a command that can be executed right away in the terminal to extract attachment from it.
# Create logs folder if not already present
logsFolder=${PROJECT_DIR}/Scripts/Logs
mkdir -p ${PROJECT_DIR}/Scripts/Logs
# Create log file in the Logs folder
myNameWithExtension=$(basename "$0")
@andrealufino
andrealufino / UITextField+Mask.swift
Last active December 24, 2017 13:41 — forked from dedeexe/UITextField+MaskPattern.swift
Adding Mask to a TextField
extension UITextField {
private struct FKFieldPatterns {
static var pattern = "pattern"
static var replacementChar = "replacementChar"
static var allowNumbers = "allowNumbers"
static var allowText = "allowText"
}
private var pattern : String {
@andrealufino
andrealufino / 0_reuse_code.js
Created July 10, 2014 10:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@andrealufino
andrealufino / ALData.h
Last active December 13, 2015 23:49
This is a singleton class to detect internet connection. It can be customized to check if internet connection is over WiFi or cellular. Example of use : if ([ALData checkInternetConnection]) NSLog(@"Internet available"); else NSLog(@"Internet unavailable");
//
// ALData.h
// AL
//
// Created by Andrea Lufino on 09/05/12.
// Copyright 2012 Andrea Lufino. All rights reserved.
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <sys/socket.h>
@andrealufino
andrealufino / SWPUtility.h
Last active December 13, 2015 23:49
This is an example of an Utility class which is useful to manage multiple xib files for different views for iPhone 4 and iPhone 5. This is an example of use : MyViewController *controller = [[MyViewController alloc] initWithNibName:[Utility nibName:@"MyNibName"] bundle:nil]; The class check if the xib to load will have to be the one for the iPho…
//
// SWPUtility.h
//
//
// Created by Andrea Lufino on 06/02/13.
// Copyright 2013 Andrea Lufino. All rights reserved.
#import <Foundation/Foundation.h>
@interface SWPUtility : NSObject