Skip to content

Instantly share code, notes, and snippets.

View Hazer's full-sized avatar

Vithorio Polten Hazer

View GitHub Profile
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 / 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;}'