Skip to content

Instantly share code, notes, and snippets.

@Numan1617
Numan1617 / keybase.md
Created January 3, 2016 10:09
keybase.md

Keybase proof

I hereby claim:

  • I am numan1617 on github.
  • I am numan1617 (https://keybase.io/numan1617) on keybase.
  • I have a public key whose fingerprint is 27A3 5F1E F5A2 5A03 D933 E683 98DD BC21 B8C2 739E

To claim this, I am signing this object:

@Numan1617
Numan1617 / gist:dff95e1332dd14cc87c3
Created April 8, 2014 08:51
iOS - Automatic Version Numbering
# Use last tag as the base for the version. E.g. tag initial commit as 0.0
LAST_TAG_VERSION=`git describe --tags | cut -f1 -d"-"`
# Optional. Same as above but keeps the commit hash
#LAST_TAG_VERSION=`git describe --tags`
# Total number of commits in the repository
TOTAL_COMMITS=`git rev-list HEAD --count`
# Write the version numbers to the compiled product
@Numan1617
Numan1617 / gist:9783467
Created March 26, 2014 13:45
Android - Automatic Version Numbering
def getVersionCode = { ->
try {
def code = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', 'HEAD', '--count'
standardOutput = code
}
return code.toString().toInteger()
}
catch (ignored) {