Skip to content

Instantly share code, notes, and snippets.

View lexer's full-sized avatar

Aleksei Zakharov lexer

View GitHub Profile
lexer / connection.getParsedTransaction
Last active January 16, 2023 17:51
VersionedTransactionResponse vs ParsedTransactionWithMeta
import org.junit.Test;
import org.junit.runner.JUnitCore;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
public class Solution {
Non-fatal Exception: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
at android.os.Handler.<init>(
at android.os.Handler.<init>(
at com.instabug.library.invoker.b.<init>(
at com.instabug.library.internal.module.a.a(
at com.instabug.library.i.b(
at com.instabug.library.i.<init>(
at com.instabug.library.Instabug$
at com.instabug.library.Instabug$
lexer / gist:b23a9e3959d732dfe23e
Created February 20, 2015 00:54
Add wallet card
public class AddWalletActivity extends Activity {
private static final String TAG = "AddWalletActivity";
private static final int REQUEST_CODE_MASKED_WALLET = 1;
private WalletFragment mWalletFragment;
public void onCreate(Bundle savedInstanceState) {
lexer / Headers
Last active August 29, 2015 14:10
User -> credits - > "0" cause JSON parse exception during POST /user on phone login
POST /users HTTP/1.1
Accept-Language en_US
Accept application/;version=21
User-Agent lyft:android:5.0:
User-Device LGE Nexus 5
X-Carrier AT&T
X-Session eyJhIjoiN2E2NzIwYTgzYzcxYzBkZiIsImYiOiIxNTBlNDNmOS00M2NkLTRjOTItYjI1Mi02NzNhMTU3NGI4NDEiLCJnIjoiMjc1NTYwMjU5MjA1NzY3In0=
Content-Type application/json; charset=utf-8
Content-Length 126
lexer / gist:9125400
Created February 20, 2014 23:18
Reduce image size when picasso fail with OutOfMemmory
private Bitmap safeLoadBitmap(File file, int width, int height) throws IOException {
RequestCreator picassoRequestBuilder = picasso.load(file)
.resize(width, height)
if (getTransformation() != null) {
Bitmap bitmap = null;
lexer / OkHttpRequest
Created May 29, 2013 11:35
Google Http Client Library OkHttp Transport
* Copyright (c) 2010 Google Inc.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express