This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// http://sapandiwakar.in/make-hexagonal-view-on-ios/ | |
extension UIView { | |
/// Set the view layer as an hexagon | |
func setupHexagonView() { | |
let lineWidth: CGFloat = 5 | |
let path = self.roundedPolygonPath(rect: self.bounds, lineWidth: lineWidth, sides: 6, cornerRadius: 10, rotationOffset: CGFloat(.pi / 2.0)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app | |
print("==== BEGIN INSTALLED FONT ====") | |
// Print every installed font | |
for family: String in UIFont.familyNames { | |
print("\(family)") | |
for names: String in UIFont.fontNames(forFamilyName: family) { | |
print("== \(names)") | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- https://stackoverflow.com/a/5448736/5746936 | |
SELECT /* + RULE */ df.tablespace_name "Tablespace", | |
df.bytes / (1024 * 1024) "Size (MB)", | |
SUM(fs.bytes) / (1024 * 1024) "Free (MB)", | |
Nvl(Round(SUM(fs.bytes) * 100 / df.bytes),1) "% Free", | |
Round((df.bytes - SUM(fs.bytes)) * 100 / df.bytes) "% Used" | |
FROM dba_free_space fs, | |
(SELECT tablespace_name, | |
SUM(bytes) bytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
applicationVariants.all { variant -> | |
variant.outputs.each { output -> | |
def outputFile = output.outputFile | |
if (outputFile != null && outputFile.name.endsWith('.apk')) { | |
def version = defaultConfig.versionName | |
//version = version.replaceAll('\\.', '_') | |
def fileName = "appName_v" + version + ".apk" | |
if(variant.name.equals("variantName")){ | |
fileName = "appName_variant_v" + version + ".apk" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIViewController+Extension.swift | |
// | |
// Created by Christian Ascone on 16/06/17. | |
// | |
import Foundation | |
import KVNProgress | |
import Onboard // https://github.com/mamaral/Onboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// VersionUtils.swift | |
// | |
// Created by Christian Ascone on 21/06/2017. | |
// Copyright © 2017 Christian Ascone. All rights reserved. | |
// | |
import Foundation | |
class VersionUtils { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UILabel+Extension.swift | |
// ShopAdvisor | |
// | |
// Created by Christian Ascone on 21/06/2017. | |
// Copyright © 2017 Luna srls. All rights reserved. | |
// | |
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PROJECT_NAME="$(ls -d *.xcworkspace* | cut -d'.' -f1)" | |
# REF: https://bitbar.com/tipstricks-how-to-archive-and-export-ipa-from-script/ | |
# Clean project | |
echo "#### CLEAN ####" | |
xcodebuild clean -workspace "${PROJECT_NAME}".xcworkspace -configuration Release -scheme "${PROJECT_NAME}" | |
# Archive | |
echo "#### ARCHIVE ####" | |
xcodebuild archive -workspace "${PROJECT_NAME}".xcworkspace -configuration Release -scheme "${PROJECT_NAME}" -archivePath "${PROJECT_NAME}".xcarchive | |
# Export ipa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openssl pkcs12 -in pushcert.p12 -out pushcert.pem -nodes -clcerts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Util class for number rounding | |
* | |
* @author Christian Ascone | |
* | |
*/ | |
public class MathRoundUtil { | |
/** | |
* Rounds a double number to the closest 0.5 divisor. | |
* For example: |
OlderNewer