Skip to content

Instantly share code, notes, and snippets.

View hectorddmx's full-sized avatar

Hector De Diego hectorddmx

View GitHub Profile
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@hectorddmx
hectorddmx / list_voices.sh
Created February 5, 2019 23:53
Listar las voces de macOS
say -v \? | while read LINE
do
SPEAKER=$(echo $LINE | egrep -o "^[a-zA-Z\-]*[ ]?[A-Z][a-z]+")
TEXT=$(echo $LINE | egrep -o "#.*" | tr "#" " ")
echo $SPEAKER
echo -ne "This is voice $SPEAKER speaking the example text: \n" $TEXT | say -v $SPEAKER
done
@hectorddmx
hectorddmx / .gitignore
Created October 8, 2018 05:03
Global Gitignore macOS
# Mac OS X hidden files
.DS_Store
# Node
npm-debug.log
# WebStorm
.idea/
@hectorddmx
hectorddmx / command.sh
Created September 21, 2018 21:34
Get AppData for running iOS Simulator
xcrun simctl get_app_container booted [BUNDLE_INDENTIFIER] data
@hectorddmx
hectorddmx / README.md
Last active September 14, 2018 19:23 — forked from guilhermearaujo/README.md
OCLint integration with Xcode

OCLint (0.13) integration with Xcode

1. Integration

  • Add a new Target of kind Aggregate, name it OCLint
  • Under Builde Phases, add a new Run Script Phase
  • Paste the script

2. Usage

  • Select target OCLint
  • Build the target (press ⌘+B)
@hectorddmx
hectorddmx / textField.regex
Created July 26, 2018 20:01
Regex to find UITextFieldDelegates
(UITextFieldDelegate)+\s*\n?\{
@hectorddmx
hectorddmx / find_named_colors_storyboard_regex.js
Created June 10, 2018 06:39
Regex to find named colors from a list
name="(ActivityIndicator|BlackTextFieldText|Blue|BlueLineSeparate|BlueLinkColor|BluePercentage|BlueProgress|BlueQuestion|BlueThankYouText|BrownCircleLineChart|BrownFillColorLineChart|BrownPieChart|DarkGrayCatalog|GrayButton|GrayLineSeparate|GrayPieChart|GrayPlaceHolder|GraySelectedRaw|GrayTextFieldLine|GrayTextFieldTitle|GreenPieChart|GreenValuesLineChart|Orange)"
@hectorddmx
hectorddmx / ignore_warnings.rb
Created June 10, 2018 06:07
Ignore framework warnings
post_install do |installer|
ignored_targets = ["autocontratacion-gonet", "Pods-autocontratacion-gonet_Example", "Pods-autocontratacion-gonet_Tests"]
puts "\nSetting up targets."
installer.pods_project.targets.each do |target|
unless ignored_targets.include?(target.name)
puts "Disabling warnings for target #{target}"
target.build_configurations.each do |config|
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = "YES"
end
else
@hectorddmx
hectorddmx / xcode-increment-build.sh
Created June 8, 2018 20:15
Auto increment build, version and save to Info.plist branch and commit, tested for xcode 9.4
echo "Setting build and version numbers..."
versionNumber=`date +%Y%m.%d`; echo "New versionNumber ${versionNumber}"
buildNumber=`date +%H%M%S`; echo "New buildNumber ${buildNumber}"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $versionNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
echo "Setting branch name..."
function parse_git_dirty() {
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*"
}
@hectorddmx
hectorddmx / UIColorExtension.md
Created May 7, 2018 01:55 — forked from bhrott/UIColorExtension.md
Swift 3: Hex UIColor

Extension:

import Foundation
import UIKit

extension UIColor {
    convenience init(hexString: String) {
        let hex = hexString.trimmingCharacters(in: CharacterSet.alphanumerics.inverted)
        var int = UInt32()
 Scanner(string: hex).scanHexInt32(&int)