Skip to content

Instantly share code, notes, and snippets.

View Lutzifer's full-sized avatar

Wolfgang Lutz Lutzifer

View GitHub Profile
@Lutzifer
Lutzifer / build.rb
Last active April 23, 2016 10:20
Code for swinject code generation
require "erb"
require "Shellwords"
require "set"
@dependencies = Set.new
@contentArray = []
@migrationArray = []
ARGV[0..-2].each do |filename|
f = File.open(filename)
@Lutzifer
Lutzifer / gist:4e3abcee7039349a0b3e8ee4105ed148
Created April 14, 2016 13:55
extract text from localizable.string for spell checking
cat Localizable.strings | cut -d "=" -f 2 | sed "s|;||g" > spellcheck.txt
@Lutzifer
Lutzifer / replaceNSlocalized.sh
Last active September 18, 2018 15:13
Automatically replace NSLocalizedString(...) in Swift with corresponding tr(...) calls for https://github.com/AliSoftware/SwiftGen. Copy both into the project and call 'sh replaceNSlocalized.sh'
#/bin/sh
# Run this inside the project to replace NSLocalizedString calls with swiftgen calls in all .swift files.
# Do not forget to make a backup before.
find . -type f | grep ".swift" > swiftindex.temp
while IFS= read -r filename
do
grep -o "NSLocalizedString(\"[^\")]*\", comment:\s*\"\")" "$filename" > strings.temp