Skip to content

Instantly share code, notes, and snippets.

View nesquena's full-sized avatar

Nathan Esquenazi nesquena

View GitHub Profile
@nesquena
nesquena / MainThreadCallback.java
Last active June 6, 2018 08:16 — forked from petitviolet/MainThreadCallback.java
OkHttp Callback on Main Thread.
public abstract class MainThreadCallback implements Callback {
private static final String TAG = MainThreadCallback.class.getSimpleName();
abstract public void onFail(final Exception error);
abstract public void onSuccess(final String responseBody);
@Override
public void onFailure(final Request request, final IOException e) {
@nesquena
nesquena / CursorRecyclerAdapter.java
Created April 3, 2017 07:13
Cursor Adapters for RecyclerView
/*
* The MIT License (MIT)
*
* Copyright (c) 2015 ARNAUD FRUGIER
*
* 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
* copies of the Software, and to permit persons to whom the Software is
@nesquena
nesquena / PatternEditableBuilder.java
Last active October 21, 2022 10:20
PatternEditableBuilder - Easy way to create colored clickable spans within a TextView!
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.regex.Matcher;
@nesquena
nesquena / SnappyRecyclerView.java
Last active June 21, 2023 23:04
Snap-to-Center RecyclerView Extension
// From: http://stackoverflow.com/a/37816976
public class SnappyRecyclerView extends RecyclerView {
// Use it with a horizontal LinearLayoutManager
// Based on http://stackoverflow.com/a/29171652/4034572
public SnappyRecyclerView(Context context) {
super(context);
}
@nesquena
nesquena / Contact.java
Last active January 15, 2023 13:03 — forked from rogerhu/Contact.java
Endless Scrolling with RecyclerVIew
package codepath.com.recyclerviewfun;
import java.util.ArrayList;
import java.util.List;
public class Contact {
private String mName;
private boolean mOnline;
public Contact(String name, boolean online) {
@nesquena
nesquena / ItemClickSupport.java
Last active September 17, 2024 18:57
Click handling for RecyclerView
/*
Source: http://www.littlerobots.nl/blog/Handle-Android-RecyclerView-Clicks/
USAGE:
ItemClickSupport.addTo(mRecyclerView).setOnItemClickListener(new ItemClickSupport.OnItemClickListener() {
@Override
public void onItemClicked(RecyclerView recyclerView, int position, View v) {
// do it
}
});
Api::App.controllers :posts, map: "api/v1/posts" do
get :index, map: "" do
end
post :create, map: "" do
end

Hey Team,

In preparation for Demo Day as finalists, there are a few things that you should do before latest August 3rd at 10pm:

  • README: If you haven't yet, send a github readme with a) paragraph about non-profit, b) paragraph about app, c) gif walkthrough ASAP
  • Presentation: Upload your slide presentation in your desired format to this Google Drive. We will make the presentation available to you on a shared laptop with support for powerpoint, keynote and PDFs.
  • App Demo
    • (iOS) Make sure to have your app ready to go on an iPhone device which will be projected onto the screen
    • (Android) Make sure to have a Nexus 4 or 5 with your app installed OR send us the APK for your app which we will install on a Nexus 5
  • There is no easy way to present more than one device at a time at the New Relic setup
@nesquena
nesquena / backburner_test_helper.rb
Created May 31, 2014 20:50
Backburner Test Helper
if Rails.env.test?
module Backburner
def self.test_mode
@test_mode ||= :fake
end
def self.test_mode=(mode)
@test_mode = mode
end
@nesquena
nesquena / top_100_mobile_companies.txt
Created September 25, 2013 06:08
Top 100 Mobile Companies
Advertising
AdColony
adcolony.com
Los Angeles, CA
Appia
appia.com
Durham, NC