Skip to content

Instantly share code, notes, and snippets.

View Hazer's full-sized avatar

Vithorio Polten Hazer

View GitHub Profile
@Hazer
Hazer / default_editor.sh
Last active November 17, 2024 04:45
Set default editor macOS
# Zed
defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=dev.zed.Zed;}'
# Sublime Text 4
defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.4;}'
# Sublime Text 3
defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.3;}'
# VS Code
@Hazer
Hazer / update_macos.sh
Created July 24, 2024 21:51
Update macOS from Terminal
sudo softwareupdate -i -a -R
@Hazer
Hazer / allow_visionos_intel.sh
Created July 4, 2024 00:09
Allow installing/running visionOS on Intel macs
defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES
defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES
xcodebuild -downloadPlatform visionOS
@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) {