Skip to content

Instantly share code, notes, and snippets.

View albertoramonj's full-sized avatar

Alberto R. albertoramonj

View GitHub Profile
@PaulTaykalo
PaulTaykalo / Appfile
Created August 26, 2016 13:05
Fastlane's Appfile for multiple users support
# In big teams instead of specifying one email to rule them all as apple_id
# You can get this information from environment variable
# By doing this it will allow different developers to specify their own apple ids
# And if this env variable is not required - then it will be asked on any command that requires apple_id
apple_id ENV["MY_APP_NAME_APPLE_ID"] # Your Apple email address
### ~/.bashrc of some user
export MY_APP_NAME_APPLE_ID="[email protected]"
@steipete
steipete / ios-xcode-device-support.sh
Last active May 11, 2025 13:30
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
//
// UIBarButtonItem+Badge.swift
// PiGuardMobile
//
// Created by Stefano Vettor on 12/04/16.
// Copyright © 2016 Stefano Vettor. All rights reserved.
//
import UIKit
@rudelm
rudelm / autofs.md
Last active July 7, 2025 20:18
Use autofs on Mac OS X to mount network shares automatically during access

Autofs on Mac OS X

With autofs you can easily mount network volumes upon first access to the folder where you want to mount the volume. Autofs is available for many OS and is preinstalled on Mac OS X so I show you how I mounted my iTunes library folder using this method.

Prepare autofs to use a separate configuration file

autofs needs to be configured so that it knows where to gets its configuration. Edit the file /etc/auto_master and add the last line:

#
# Automounter master map
#

+auto_master # Use directory service

@ashishkakkad8
ashishkakkad8 / AFWrapper.swift
Last active January 13, 2020 07:08
Alamofire - SwiftyJSON Wrapper
//
// AFWrapper.swift
// AFSwiftDemo
//
// Created by Ashish on 10/4/16.
// Copyright © 2016 Ashish Kakkad. All rights reserved.
//
import UIKit
import Alamofire
@aoriani
aoriani / tweet_ip.py
Created November 23, 2015 04:16
A simple python script that tweets the external public IP to a private Twitter account. The idea is to create an alternative to dynamic DNS services. In practice you only need the IP of your remote host. The script is going to be run daily by cron. The beauty of Twitter API is that it prevents duplicated message. Thus you will only get a new tw…
#!/usr/bin/env python
import sys
import tweepy
import urllib2
CONSUMER_KEY = "<your consumer key>"
CONSUMER_SECRET = "<your consumer secret>"
ACCESS_TOKEN = "<your access token>"
ACCESS_TOKEN_SECRET = "<your access secret>"
@ppamorim
ppamorim / ImageInsets.swift
Created November 5, 2015 16:30
Add padding/margin at a image!
import UIKit
extension UIImage {
func imageWithInsets(insetDimen: CGFloat) -> UIImage {
return imageWithInset(UIEdgeInsets(top: insetDimen, left: insetDimen, bottom: insetDimen, right: insetDimen))
}
func imageWithInset(insets: UIEdgeInsets) -> UIImage {
UIGraphicsBeginImageContextWithOptions(
CGSizeMake(self.size.width + insets.left + insets.right,
@gservera
gservera / LegalInfoValidation.swift
Last active June 10, 2019 11:33
Validar DNI español o calcular su letra en Swift 2.0
import Foundation
/**
Valida el número y la(s) letra(s) de un cualquier documento nacional de identidad
español (NIF o NIE) utilizando una implementación del algoritmo oficial.
- parameter nationalID: El DNI que se validará. No distingue mayúsculas y minúsculas.
- returns: `true` si el DNI proporcionado es válido o `false` si no lo es.
*/
func validateSpanishNationalIdentifier(nationalID: String) -> Bool {
guard nationalID.characters.count == 9 else {
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 17, 2025 05:44
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@RuGa
RuGa / massInsertOrUpdate.php
Last active December 11, 2024 23:14
Mass (bulk) insert or update on duplicate for Laravel 4/5
/**
* Mass (bulk) insert or update on duplicate for Laravel 4/5
*
* insertOrUpdate([
* ['id'=>1,'value'=>10],
* ['id'=>2,'value'=>60]
* ]);
*
*
* @param array $rows