Skip to content

Instantly share code, notes, and snippets.

View juliengdt's full-sized avatar
🎯
Focusing

juliengdt juliengdt

🎯
Focusing
View GitHub Profile
@juliengdt
juliengdt / AUTHORS.md
Created August 27, 2014 07:42
AUTHORS.md template

Project Authors

This is where your explain when the project started, for which client, and list all devteams who contributes to it.

Project technical leads:

  • John Foo - position - City (Country)
  • Bar Doe - position - City (Country)
@juliengdt
juliengdt / CHANGELOG.md
Last active September 5, 2023 09:27
CHANGELOG.md template

CHANGELOG.md

1.8.0 (unreleased)

Features:

  • add support for SVN sources -> 95f32s5b
  • add metadata allowed_push_host to new gem template -> 95f32s5b
  • adds a --no-install flag to bundle package -> 95f32s5b
@juliengdt
juliengdt / README.md
Last active November 6, 2017 01:13
README.md template

NAME-OF-YOUR-PROJECT

This is a template README to show which informations it should contain.

You can talk about general purpose here in 2~3 lines to explain what it is.

Installation

Requirements

This is the requirement block; it explains which SW/HW you have to grab to run this project

@juliengdt
juliengdt / HowTo_Markdown.md
Created August 27, 2014 07:47
Markdown usage in a project

Markdown

Markdown Usage in Your Project

What it means ?

It means to use Markdown formatting and Markdown files to enhance your projects, more precisely the management around it.

Markdown synthax is essentially used for formatting raw text into a bit more sexy one (This file is MD formatted !).

@juliengdt
juliengdt / hook-system-git.md
Created August 27, 2014 07:48
Hook system in Git

commit-msg - The Hook

Hooks are plugins which can be launch by git, on a special event. The commit-msg hook, if defined, is launched when user want commit

It's a git-enforced policy, used in entreprise to force dev to correctly format their commit messages

A custom one

Here is a custom commit-msg hook which looks for a format like these both:

  • [ADD] - It's a message where i add something
@juliengdt
juliengdt / commit-msg
Created August 27, 2014 07:50
commit-msg
#!/bin/sh
# author: julien gdt
# regex='^[\[](ADD|IMP|FIX)[\]]'
# regexjira='^[\[]JIRA[\]][[:space:]][\#][0-9]'
# regexversion='^Version[[:space:]][0-9]\.[0-9]\.[0-9][[space:]][a-zA-Z]{3,}'
var=`head -n 1 "$1"`
function info
@juliengdt
juliengdt / versionAndBuild.swift
Created April 21, 2015 08:46
[SWIFT] App Version & Build Number
extension UIApplication {
class func appVersion() -> String {
return NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString") as! String
}
class func appBuild() -> String {
return NSBundle.mainBundle().objectForInfoDictionaryKey(kCFBundleVersionKey as String) as! String
}
@juliengdt
juliengdt / .gitignore
Last active July 27, 2016 21:04
XCode Gitignore
# Created by https://www.gitignore.io/api/carthage,objective-c,swift,xcode,osx
### Carthage ###
# Carthage - A simple, decentralized dependency manager for Cocoa
Carthage.checkout
Carthage.build
### Objective-C ###
# Xcode
@juliengdt
juliengdt / jackyScript.sh
Created July 20, 2015 16:06
Jacky Script for Xcode Build Phases
#CODE COMPLEXITY
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -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." }'
#TODO & FIXME CHECKER
KEYWORDS="TODO|FIXME|\?\?\?:|\!\!\!:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -and \( -path "${SRCROOT}/Pods/*" -prune -o -print0 \) | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"
#TOTAL LINES - USELESS BUT FUN
echo "Total lines of code:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" -or -name "*.swift" \) -and \( -path "${SRCROOT}/Pods/*" -prune -o -print0 \) | xargs -0 cat | wc -l
@juliengdt
juliengdt / UIViewExtension.swift
Last active August 29, 2015 14:25
ClosureMiniKit
//
// UIViewExtension.swift
// SwiftTester
//
// Created by JulienGdt on 07/07/15.
// Copyright (c) 2015 JulienGdt @jlngdt. All rights reserved.
// @see https://gist.github.com/juliengdt/a80deda0ed2240b4d347
//
import UIKit