Skip to content

Instantly share code, notes, and snippets.

View nschwermann's full-sized avatar
:shipit:

Nathan Schwermann nschwermann

:shipit:
View GitHub Profile
/**
* Twitter API v2 - Post a Tweet with GIF Example
*
* This example demonstrates how to post a tweet with a GIF attachment
* using the twitter-api-v2 library and Twitter's v2 API endpoints.
*
* Prerequisites:
* 1. Twitter Developer Account
* 2. App with Read and Write permissions
* 3. API Keys and Access Tokens
@nschwermann
nschwermann / README.md
Created May 16, 2013 18:03
Solarized IntelliJ Theme

This tweaks the darcula IntelliJ theme to better match the solarized color scheme found here https://github.com/jkaving/intellij-colors-solarized

To enable, after installing the color scheme linked above set your theme to darcula.

Preferences -> Appearance -> Theme -> Darcula

Exit IntelliJ then add the tweaked darcula properties file to the idea.jar file with the following command

jar -ufv idea.jar com/intellij/ide/ui/laf/darcula/darcula.properties 
#!/usr/bin/python
'''
Copyright 2009, The Android Open Source Project
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
@nschwermann
nschwermann / DesignSupport.kt
Last active November 22, 2020 06:38 — forked from mgranberry/DesignSupport.kt
collection of kotlin extensions for android development
package org.jetbrains.anko
import android.app.Activity
import android.support.annotation.StringRes
import android.support.design.widget.*
import android.support.v4.app.Fragment
import android.view.View
import android.view.ViewManager
import java.util.concurrent.atomic.AtomicInteger
@nschwermann
nschwermann / mobile-AndroidManifest.xml
Created June 30, 2014 02:58
Android Wearable Message API example
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="schwiz.net.weartest" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
@nschwermann
nschwermann / keybase.md
Created December 3, 2019 06:42
keybase proof

Keybase proof

I hereby claim:

  • I am nschwermann on github.
  • I am nschwermann (https://keybase.io/nschwermann) on keybase.
  • I have a public key ASAff3locbJ9zf46P1nayfMpXzkXVsl3U-RvgYG8KInEwgo

To claim this, I am signing this object:

@nschwermann
nschwermann / CoroutineDialog.kt
Last active February 20, 2019 23:22
CoroutineDialog
abstract class CoroutineDialog<T>(context : Context, private val channel: Channel<DialogMessage<T>>) : AlertDialog(context) {
init {
setOnCancelListener {
channel.offer(DialogMessage.Cancelled)
}
}
fun positiveChannel(text : String, block : (() -> T)? = null) {
setButton(AlertDialog.BUTTON_POSITIVE, text){d, _ ->
@nschwermann
nschwermann / ProgressView
Last active June 14, 2018 08:39
Material ProgressView
/*
* Copyright (C) 2013 The Android Open Source Project
*
* 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
@nschwermann
nschwermann / HeaderAdapter
Created December 20, 2014 16:42
RecyclerView HeaderAdapter
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@nschwermann
nschwermann / IonDataSource.java
Created October 2, 2014 22:16
Custom DataSource for ExoPlayer that uses ION/AndroidAsync
import android.content.Context;
import android.net.Uri;
import android.text.TextUtils;
import com.google.android.exoplayer.C;
import com.google.android.exoplayer.upstream.DataSource;
import com.google.android.exoplayer.upstream.DataSpec;
import com.google.android.exoplayer.upstream.HttpDataSource;
import com.google.android.exoplayer.upstream.TransferListener;
import com.google.android.exoplayer.upstream.UnexpectedLengthException;