I hereby claim:
- I am sourabhv on github.
- I am sourabhv (https://keybase.io/sourabhv) on keybase.
- I have a public key ASDcNNUxAtMIPrgb6Vt-gd7PWl61zqV8XUnM06g9gM_H7Qo
To claim this, I am signing this object:
| #!/bin/bash | |
| # MIT License | |
| # ----------------------------------------------------------------------------- | |
| # Copyright 2022 Sourabh Verma | |
| # Permission is hereby granted, free of charge, to any person obtaining a copy | |
| # of this software and associated documentation files (the "Software"), to deal | |
| # in the Software without restriction, including without limitation the rights | |
| # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| #!/bin/bash | |
| set -eu | |
| SENTRY_DOWNLOAD_Linux_i686="https://downloads.sentry-cdn.com/sentry-cli/1.37.4/sentry-cli-Linux-i686" | |
| SENTRY_DOWNLOAD_Windows_x86_64="https://downloads.sentry-cdn.com/sentry-cli/1.37.4/sentry-cli-Windows-x86_64.exe" | |
| SENTRY_DOWNLOAD_Darwin_x86_64="https://downloads.sentry-cdn.com/sentry-cli/1.37.4/sentry-cli-Darwin-x86_64" | |
| SENTRY_DOWNLOAD_Linux_x86_64="https://downloads.sentry-cdn.com/sentry-cli/1.37.4/sentry-cli-Linux-x86_64" | |
| SENTRY_DOWNLOAD_Windows_i686="https://downloads.sentry-cdn.com/sentry-cli/1.37.4/sentry-cli-Windows-i686.exe" | |
| VERSION="1.38.0" | |
| PLATFORM=`uname -s` |
| var markdownIt = require('markdown-it') | |
| function delim_plugin(md) { | |
| // Insert each marker as a separate text token, and add it to delimiter list | |
| // | |
| function tokenize(state, silent) { | |
| var i, scanned, token, len, ch, | |
| start = state.pos, | |
| marker = state.src.charCodeAt(start); |
I hereby claim:
To claim this, I am signing this object:
| public class AddressRepository implements BaseRepo<Address> { | |
| private final RestApi mRestApi; | |
| private final BriteDatabase mDatabase; | |
| public AddressRepository(RestApi restApi, BriteDatabase database) { | |
| mRestApi = restApi; | |
| mDatabase = database; | |
| } |
| SqlBrite sqlBrite = new SqlBrite.Builder().build(); | |
| BriteDatabase database = sqlBrite.wrapDatabaseHelper(openHelper, Schedulers.io()); | |
| // Insert transaction | |
| Transaction transaction = database.newTransaction(); | |
| Address.InsertRow insertRow = new Address.InsertRow(database.getWritableDatabase()); | |
| try { | |
| insertRow.bind(1, "Home", "House No. 42", "Foo Lane", null, "Gurgaon", "India", 123456); | |
| database.executeInsert(Address.TABLE_NAME, insertRow.program); |
| @AutoValue | |
| public abstract class Address implements AddressModel, Parcelable { | |
| public static final Factory<Address> FACTORY = new Factory<>(AutoValue_Address::new); | |
| public static final Func1<Cursor, Address> MAPPER = FACTORY.selectAllMapper()::map; | |
| public static Builder builder() { | |
| return new AutoValue_Address.Builder(); | |
| } |
| @AutoValue | |
| public abstract class Address implements AddressModel { | |
| public static final Factory<Address> FACTORY = new Factory<>(new AddressModel.Creator<Address>() { | |
| @Override | |
| public Address create(long id, @NonNull String name, @NonNull String line1, @Nullable String line2, @Nullable String landmark, @NonNull String city, @NonNull String country, long pincode) { | |
| return Address.builder() | |
| .id(id) | |
| .name(name) | |
| .line1(line1) |
| CREATE TABLE address ( | |
| id INTEGER NOT NULL, | |
| name TEXT NOT NULL, | |
| line1 TEXT NOT NULL, | |
| line2 TEXT, | |
| landmark TEXT, | |
| city TEXT NOT NULL, | |
| country TEXT NOT NULL, | |
| pincode INTEGER NOT NULL, | |
| PRIMARY KEY(id) ON CONFLICT REPLACE |
| public interface BaseRepository<T> { | |
| Observable<T> add(T item); | |
| Observable<List<T>> add(List<T> items); | |
| Observable<T> query(long id); | |
| Observable<List<T>> query(); | |
| Observable<T> update(T item); | |
| Observable<Integer> remove(T item); | |
| } |