Skip to content

Instantly share code, notes, and snippets.

View danielpetroianu's full-sized avatar
🔩
it works on my machine

Petroianu Daniel danielpetroianu

🔩
it works on my machine
View GitHub Profile
@danielpetroianu
danielpetroianu / docker-homer-generator.sh
Last active January 20, 2022 14:36
Generate Homer services from docker labels. Inspired by https://github.com/pawelmalak/flame
#!/bin/bash
_DOCKER_LABEL_NAME="homer.service.name"
_DOCKER_LABEL_URL="homer.service.url"
_DI_RESULT_JSONKEY_CATEGORY="category"
_DI_RESULT_JSONKEY_CATEGORY_ICON="category_icon"
_DI_RESULT_JSONKEY_CATEGORY_ORDER="category_order_index"
_DI_RESULT_JSONKEY_ICON="icon"
_DI_RESULT_JSONKEY_NAME="name"
#!/usr/bin/env ruby
# Sets in a pod the given build setting
#
# @param [Xcodeproj::Project] project
# The xcode project instance.
#
# @param [Hash] build_settings
# An hash with the build configurations
#
@danielpetroianu
danielpetroianu / generate_public_private_modulemap.swift
Last active March 19, 2020 02:46
Create framework Public/Private header lists
#!/usr/bin/env xcrun --sdk macosx swift
import Foundation
fileprivate extension Array {
func separate(where condition: (Element) -> Bool) -> ([Element], [Element]) {
return self.reduce( ([Element](), [Element]()) ) { (result, nextElement) -> ([Element], [Element]) in
if condition(nextElement) {
return (result.0 + [nextElement], result.1)
}
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -and \( -path "${SRCROOT}/Pods/*" -prune -o -print0 \) \
| xargs -0 wc -l \
| awk '$1 > 400 && $2 != "total" {for(i=2;i<NF;i++){printf "%s%s", $i, " "} print $NF ":1: warning: File more than 400 lines (" $1 "), consider refactoring." }'
KEYWORDS="TODO|FIXME|\?\?\?:|\!\!\!:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -and \( -path "${SRCROOT}/Pods/*" -prune -o -print0 \) \
| xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" \
| perl -p -e "s/($KEYWORDS)/ warning: \$1/"
if [ ${CONFIGURATION} == "Release" ]; then
APPLEDOC_PATH=`which appledoc`
if [ $APPLEDOC_PATH ]; then
$APPLEDOC_PATH \
--project-name ${PRODUCT_NAME} \
--project-company "<Your Name>" \
--company-id "<com.yourcompany>" \
--output ${PRODUCT_NAME}Docs \
--keep-undocumented-objects \
--keep-undocumented-members \
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.4.3 (252)
#
# Alignment
# ---------
## Alignment