Skip to content

Instantly share code, notes, and snippets.

View loganj's full-sized avatar

Logan Johnson loganj

  • Square, Inc.
  • New York, NY
View GitHub Profile
@loganj
loganj / script.sh
Last active April 3, 2024 03:45 — forked from dlew/script.sh
Simple AndroidX Migration Script
#!/usr/bin/env bash
# Original by Dan Lew
#
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very
# well, so I wrote my own script to do the simple job of converting package names.
#
# You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv
#
# It'll run faster on a clean build because then there are fewer files to scan over.
#
commit cb5f051c5ee95e795dedaf3a264062cf75d44b1e
Author: Logan Johnson
Date: Mon Aug 8 14:41:04 2016 -0400
don't register Transaction in multiple scopes
RA-14998
TransactionBundler used to implement both Bundler and PausesAndResumes.
In order to correct a lifecycle tangle (obvious from the dual
commit ee46355557abe4ebc816f6cef9821e64c25b22f0
Author: Logan Johnson
Date: Wed Dec 9 17:49:35 2015 -0500
GET /account/status
diff --git a/common/services/src/main/java/com/squareup/server/account/AccountService.java b/common/services/src/main/java/com/squareup/server/account/AccountService.java
index da02d2f..20c7c43 100644
--- a/common/services/src/main/java/com/squareup/server/account/AccountService.java
+++ b/common/services/src/main/java/com/squareup/server/account/AccountService.java
/**
* Copyright 2014 Square 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@loganj
loganj / RxGitHub.java
Created November 8, 2013 23:44
What if Retrofit handled rx Func1 return types?
import java.util.Collections;
import java.util.List;
import retrofit.http.GET;
import retrofit.http.Path;
import rx.Observable;
import rx.util.functions.Func1;
public class RxGitHub {
static <T> Func1<Iterable<T>,Observable<T>> iterableToObservable() {
@loganj
loganj / gist:6630117
Last active December 23, 2015 11:39
This is probably a bad idea.
package com.squareup.otto;
/**
* A bus which supports detaching from its parent and attaching new children.
*
* THIS IS A THOUGHT EXPERIMENT. Don't freak out.
*/
public interface DetachableBus extends Bus {
/**
@loganj
loganj / main.sbt
Created January 31, 2012 06:07
Sample config for android-plugin/library pull request
import sbt._
import Keys._
import AndroidKeys._
libraryDependencies ++= Seq(
"com.actionbarsherlock" % "library" % "4.0.0-SNAPSHOT" artifacts(Artifact("library", "apklib", "apklib")),
"android" % "compatibility-v4" % "r3-SNAPSHOT"
)
window.Funnel = (->
_initialized = false
_urls = {}
_viewModel = {}
_campaignId = ""
_campaignTitle = ""
modelFunnel = (funnel, unthanked) ->
// ...
import java.util.Collections;
import java.util.Set;
class IncompatibleTypes {
interface A {}
interface B<T> {}
static abstract class C<T> {
abstract Set<A> getAsForB(B<T> b);
package com.joelapenna.foursquared.widget;
import android.widget.CheckBox;
import android.widget.Checkable;
import android.widget.ProgressBar;
import android.widget.ViewSwitcher;
final public class BusyCheckBox extends ViewSwitcher implements Checkable {
final private CheckBox checkBox;