Skip to content

Instantly share code, notes, and snippets.

View barbeau's full-sized avatar

Sean Barbeau barbeau

View GitHub Profile
@zhuowei
zhuowei / glassservices.md
Created June 2, 2013 18:20
Glass services teardown

Here are some tidbits from my Glass Services teardown (not actually an APK teardown, more like a odex teardown)

In summary: nothing groundbreaking; everything in here is known anyways.

Eye Gestures

In GlassGestureService, the service detecting winks, there's this enum:

@broady
broady / 1MarkerAnimation.java
Last active March 13, 2024 12:44
Animating Markers
/* Copyright 2013 Google Inc.
Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0.html */
package com.example.latlnginterpolation;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.os.Build;
@mufumbo
mufumbo / gist:6406055
Created September 1, 2013 17:44
proguard configuration that we use to shrink a spring-mvc project that is deployed on appengine. our goal was to reduce startup time and improve the issues with cold startup. we used spring-mvc, velocity and JDO
##---------------Begin: proguard configuration common for all Android apps ----------
-optimizationpasses 1
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
#-dump class_files.txt
#-printseeds seeds.txt
#-printusage unused.txt
@mscharhag
mscharhag / Java8DateTimeExamples.java
Created February 24, 2014 19:53
Examples for using the Java 8 Date and Time API (JSR 310)
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalAdjusters;
import java.util.*;
import static java.time.temporal.TemporalAdjusters.*;
public class Java8DateTimeExamples {
@JakeWharton
JakeWharton / ForegroundImageView.java
Created July 10, 2014 16:42
An ImageView which supports a foreground drawable.
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;
public class ForegroundImageView extends ImageView {
private Drawable foreground;
@irees
irees / README.md
Last active December 10, 2020 11:50

Transitland Frequency Visualization

Accompanies blog post: Transit dimensions: Transitland Schedule API

The frequency.py script:

  • Fetches all trips on a given date, between a start time and end time, inside of a bounding box
  • Calculates the number of connections between every stop
  • Uses a colormap and line width to show more frequent service
  • Outputs a GeoJSON map as output.geojson
@joakime
joakime / log4j.xml
Created June 22, 2016 20:55
Example log4j.xml useful for Jetty server side logging (if properly setup)
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true"
xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%5p [%t] (%c) - %m%n" />
</layout>
</appender>
@daniestevez
daniestevez / gal_almanac.xml
Last active July 22, 2019 05:24
Galileo outage data 2019-07-15 22:00 to 2019-07-16 05:30 UTC
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="15">
<GNSS-SDR_gal_almanac_map class_id="0" tracking_level="0" version="0">
<count>22</count>
<item_version>0</item_version>
<item class_id="1" tracking_level="0" version="0">
<first>1</first>
<second class_id="2" tracking_level="0" version="0">
<i_satellite_PRN>1</i_satellite_PRN>
@LouisCAD
LouisCAD / FusedLocationFlow.kt
Last active May 23, 2024 12:11
Create a Flow of location updates on Android (using kotlinx.coroutines), backed by Fused Location Provider from Google Play Services.
/*
* Copyright 2019 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
*/
import android.location.Location
import com.google.android.gms.location.LocationCallback
import com.google.android.gms.location.LocationRequest
import com.google.android.gms.location.LocationResult
import com.google.android.gms.location.LocationServices
import kotlinx.coroutines.CancellationException
<!-- Copyright 2020 Google LLC.
SPDX-License-Identifier: Apache-2.0 -->
// Don't do this. Use liveData instead.
class MyViewModel : ViewModel() {
private val _result = MutableLiveData<String>()
val result: LiveData<String> = _result
init {
viewModelScope.launch {