Skip to content

Instantly share code, notes, and snippets.

View Hazer's full-sized avatar

Vithorio Polten Hazer

View GitHub Profile
@Hazer
Hazer / howToConfigureFirebaseFlavorsIos.md
Last active November 22, 2023 22:23
iOS GoogleServices-Info.plist per app flavor

iOS GoogleServices-Info.plist per app flavor

Create a new build phase

Create a new build phase, run script, make sure to move it to the top, you may name it something like "Copy Google-Services plist", and use the following content:

PATH_TO_CONFIG=$SRCROOT/Configs/GoogleService-Info-$CURRENT_FLAVOR.plist
# https://github.com/firebase/firebase-ios-sdk/issues/11400#issuecomment-1609413066
GSPLIST_FOLDER="$BUILT_PRODUCTS_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/"
mkdir -p "$GSPLIST_FOLDER"
cp $PATH_TO_CONFIG "$GSPLIST_FOLDER/GoogleService-Info.plist"
@Hazer
Hazer / gist:94ac34e4e921ba4097fb588b41e5a2d5
Last active January 6, 2022 14:06 — forked from wishfoundry/gist:7036457
Set OSX default text editor to sublime text 4 instead of TextEdit
defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.4;}'
@Hazer
Hazer / bodyless response curl
Created April 25, 2019 18:45
Curl shortcut to show only headers and informations but not showing response body
curl -svo. <URL>
curl -svo. -X POST <URL>
# https://stackoverflow.com/a/55164669/4344807
@Hazer
Hazer / Sample.swift
Created July 4, 2018 23:05
Swift measure method execution
TimeMeasurer.posixClock("Dependecies configuration") {
self.setupDependencies()
}
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, json, argparse
print os.getcwd()
parser = argparse.ArgumentParser(description='Convert color assets from storyboards and xibs')
parser.add_argument('--colorSpace', dest="color_space",
type=str,
public abstract class CustomizedTypeAdapterFactory<C>
implements TypeAdapterFactory {
private final Class<C> customizedClass;
public CustomizedTypeAdapterFactory(Class<C> customizedClass) {
this.customizedClass = customizedClass;
}
@SuppressWarnings("unchecked") // we use a runtime check to guarantee that 'C' and 'T' are equal
public final <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
@Hazer
Hazer / zsh.md
Created March 6, 2017 03:07 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
@Hazer
Hazer / version_conflicts_gradle.md
Created July 14, 2016 22:00 — forked from uarun/version_conflicts_gradle.md
Resolving version conflicts in Gradle

Resolving Version Conflicts in Gradle

If one module has a dependency on version 1.1 of library X and another module on version 2.0 of the same library, gradle will use the latest version.

Failing a build on version conflict

To make gradle fail the build on encountering a conflict, we can do the following:

configurations.all {

resolutionStrategy {

@Hazer
Hazer / README.md
Created July 14, 2016 22:00 — forked from cr7pt0gr4ph7/README.md
Gradle Dependency Resolution

Gradle Dependency Resolution

Normal Gradle behavior

The default behavior of Gradle to pick the newest version also applies if a lower version has been declared locally, but another dependency transitively pulls in a newer version. This is in contrast with Maven, where a locally declared version will always win.

For example, if your build.gradle specifies the dependency org.springframework:spring-tx:3.2.3.RELEASE, and another dependency declares 4.0.5.RELEASE as a transitive dependency, then 4.0.5.RELEASE will take precedence:

dependencies {
    compile("org.springframework.data:spring-data-hadoop:2.0.0.RELEASE")
    compile("org.springframework:spring-tx:3.2.3.RELEASE")

// will select org.springframework:spring-tx:4.0.5.RELEASE