Skip to content

Instantly share code, notes, and snippets.

@yawarsohail
yawarsohail / increment_build_number.js
Created July 18, 2017 08:45
Cordova Hook to change version code before building.
#!/usr/bin/env node
// It changes version code before making build.
// You can see this link, on how I signed my apk using hooks. (https://gist.github.com/yawarsohail/1b2998d5cd860e01193cec86f6329223)
// Added below lines in script part of package.json to make build easy. (I think its prety easy, no need for description).
// "release": "TARGET=ii ionic build ios --device --release && TARGET=aa ionic build --release android",
// "release-a": "TARGET=a ionic build --release android",
// "release-i": "TARGET=i ionic build ios --device --release"
//
// Save hook under `project-root/scripts`
@yawarsohail
yawarsohail / change_name.js
Last active September 30, 2019 21:37
Cordova Hook to change name of generated builds and Push code to a new branch in git.
#!/usr/bin/env node
// This hook will do alot of things, you can take what you want and delete un necessary things.
// It pushes code to git, with version name as branch.
// It adds i and a in branch name to define android and ios.
// It renames the final IPA file with version code.
// It renames the final signed apk file with version code.
// Hook to increment build number before making build. (https://gist.github.com/yawarsohail/b8d7762e4617a20b6f66fcffe6599920)
// You can see this link, on how I signed my apk using hooks. (https://gist.github.com/yawarsohail/1b2998d5cd860e01193cec86f6329223)
// Added below lines in script part of package.json to make build easy. (I think its prety easy, no need for description).
@yawarsohail
yawarsohail / add_keystore_android.js
Last active July 12, 2017 13:38
Cordova Hook for adding keystore file when android platform is added.
#!/usr/bin/env node
// This hook will copy keystore and its properties file in android
// platform directory when ever android platform is added.
//
// Save hook under `project-root/scripts`
//
// Don't forget to install xml2js using npm if it is not already installed.
// `$ npm install xml2js`
@yawarsohail
yawarsohail / TypefaceSpan.java
Last active August 29, 2015 14:08 — forked from twaddington/TypefaceSpan.java
forked from twaddington/TypefaceSpan.java, Added option in Constructor for changing Colour.
/*
* Copyright 2013 Simple Finance Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@yawarsohail
yawarsohail / Epoch.cs
Created December 3, 2013 07:56 — forked from txdv/Epoch.cs
using System;
namespace Epoch
{
public class Epoch
{
static readonly DateTime epochStart = new DateTime(1970, 1, 1, 0, 0, 0);
static readonly DateTimeOffset epochDateTimeOffset = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);