Skip to content

Instantly share code, notes, and snippets.

View sourabhv's full-sized avatar

Sourabh Verma sourabhv

View GitHub Profile
@sourabhv
sourabhv / SqlBriteExample.java
Last active May 26, 2017 05:32
Repository Design Pattern in Android using RxJava, Retrofit, SQLBrite and SQLDelight Raw
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);
@sourabhv
sourabhv / AddressRepository.java
Last active May 26, 2017 05:37
Repository Design Pattern in Android using RxJava, Retrofit, SQLBrite and SQLDelight Raw
public class AddressRepository implements BaseRepo<Address> {
private final RestApi mRestApi;
private final BriteDatabase mDatabase;
public AddressRepository(RestApi restApi, BriteDatabase database) {
mRestApi = restApi;
mDatabase = database;
}

Keybase proof

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:

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);
#!/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`
@sourabhv
sourabhv / wsl-vpn-net-fix.sh
Created August 18, 2022 22:46
Bash script to fix internet access in WSL2 via powershell when connected to VPN which changes network interface adapter (like Cisco AnyConnect)
#!/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