Skip to content

Instantly share code, notes, and snippets.

@creativepsyco
creativepsyco / test.dart
Created September 29, 2022 15:15
plaid_linking_test
import 'dart:convert';
void main() {
final uri = Uri.parse(
'plaidlink://connected?public_token=public-sandbox-83f5f6ce-0689-4c53-b92a-6982542c7818&account_id=bnogd7QqKmsq87VmKLVRfZNZleJL37cNApgv1&account_mask=0000&account_name=Plaid%20Checking&account_subtype=checking&account_type=depository&accounts=%5B%7B%22_id%22%3A%22bnogd7QqKmsq87VmKLVRfZNZleJL37cNApgv1%22%2C%22meta%22%3A%7B%22name%22%3A%22Plaid%20Checking%22%2C%22number%22%3A%220000%22%7D%2C%22subtype%22%3A%22checking%22%2C%22type%22%3A%22depository%22%7D%2C%7B%22_id%22%3A%22mxwb1EZPj8UWjKvmRevGFDMDGmxqjECMBZR3z%22%2C%22meta%22%3A%7B%22name%22%3A%22Plaid%20Saving%22%2C%22number%22%3A%221111%22%7D%2C%22subtype%22%3A%22savings%22%2C%22type%22%3A%22depository%22%7D%2C%7B%22_id%22%3A%22y1R5mBzpE8fKrzwVNJwafzbzV3qnrZuWVRkvX%22%2C%22meta%22%3A%7B%22name%22%3A%22Plaid%20Credit%20Card%22%2C%22number%22%3A%223333%22%7D%2C%22subtype%22%3A%22credit%20card%22%2C%22type%22%3A%22credit%22%7D%5D&institution_id=ins_5&institution_name=Citibank%20Online&link_se
@creativepsyco
creativepsyco / location_plugin.leak
Created October 12, 2020 10:49
Location Plugin Leak
D/LeakCanary: ​
┬───
│ GC Root: Global variable in native code
├─ android.location.LocationManager$GnssStatusListenerTransport instance
│ Leaking: UNKNOWN
│ Retaining 6839 bytes in 64 objects
│ ↓ LocationManager$GnssStatusListenerTransport.mGnssNmeaListener
│ ~~~~~~~~~~~~~~~~~
├─ com.lyokone.location.FlutterLocation$3 instance
@creativepsyco
creativepsyco / LocationInputScreen.java
Created January 19, 2016 03:46
Get account info from the phone. Requires ACCOUNT Permission in the manifest.
Account[] accounts = AccountManager.get(getView().getContext()).getAccounts();
Set<String> emailSet = new HashSet<>();
for (Account account : accounts) {
if (EMAIL_PATTERN.matcher(account.name).matches()) {
emailSet.add(account.name);
}
}
getView().txtPlaceName.setAdapter(new ArrayAdapter<>(getView().getContext(),
android.R.layout.simple_dropdown_item_1line, new ArrayList<>(emailSet)));
diff --git i/app/src/main/java/org/fossasia/openevent/activities/MainActivity.java w/app/src/main/java/org/fossasia/openevent/activities/MainActivity.java
index 1c80d92..9b01b7f 100644
--- i/app/src/main/java/org/fossasia/openevent/activities/MainActivity.java
+++ w/app/src/main/java/org/fossasia/openevent/activities/MainActivity.java
@@ -35,35 +35,30 @@ import org.fossasia.openevent.OpenEventApp;
import org.fossasia.openevent.R;
import org.fossasia.openevent.dbutils.DataDownload;
import org.fossasia.openevent.dbutils.DbSingleton;
-import org.fossasia.openevent.events.CantDownloadEvent;
-import org.fossasia.openevent.events.CounterEvent;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.isEnabled;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static org.hamcrest.Matchers.not;
@creativepsyco
creativepsyco / BaseMigration.java
Created April 24, 2015 17:51
Realm Migration Example
package com.example.sample.orm.migration;
import com.google.common.base.Preconditions;
import com.example.sample.framework.base.ui.AppLogger;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import io.realm.Realm;
@creativepsyco
creativepsyco / headers
Last active August 29, 2015 14:18
Spam
Delivered-To: xxx@gmail.com
Received: by 10.107.151.212 with SMTP id z203csp338871iod;
Thu, 9 Apr 2015 05:00:50 -0700 (PDT)
X-Received: by 10.194.235.71 with SMTP id uk7mr59805915wjc.13.1428580848509;
Thu, 09 Apr 2015 05:00:48 -0700 (PDT)
Return-Path: <sputty@012.net.il>
Received: from mtaout20.012.net.il (mtaout20.012.net.il. [80.179.55.166])
by mx.google.com with ESMTP id fu19si23795394wjc.14.2015.04.09.05.00.47
for <xxx@gmail.com>;
@creativepsyco
creativepsyco / apktool.rb
Last active August 29, 2015 14:16
Apktool Brew 2.0.0rc4
require 'formula'
class Apktool < Formula
homepage 'http://android-apktool.googlecode.com/'
url 'https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.0.0rc4.jar'
sha1 '61123bcc472fa76907d405d82afda1c6e40c46bf'
resource 'exes' do
url 'https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/osx/apktool'
sha1 '508f031c81b42386ddc5fff304fee3ae11fd765b'
@creativepsyco
creativepsyco / build.gradle
Created February 18, 2015 04:19
Automatically add Git revision information when building SNAPSHOT versions of an App
Integer VERSION_CODE = 16
String VERSION_NAME = getVersionName("0.4-SNAPSHOT")
def getVersionName(String preferredVersionName) {
if (preferredVersionName.contains("-SNAPSHOT")) {
return getGitStatus(preferredVersionName)
} else {
return preferredVersionName
}
@creativepsyco
creativepsyco / BatchAuthorizer.java
Created January 28, 2015 02:58
Batch Authorizer for Pusher Java Client.
class BatchAuthorizer extends HttpAuthorizer {
private final Collection<String> channelsToSub;
private Map<String, JSONObject> cachedAuthMap = new HashMap<>();
/**
* We need the socket id to know when to refresh the batch auth data
*/
private String authSocketId = "";