Skip to content

Instantly share code, notes, and snippets.

@adamsp
adamsp / Full Stats WA import string
Last active May 30, 2020
Primary Stat Weak Aura
View Full Stats WA import string
!TVvBZPTUs4)lmtNHm3gcM35CN(bcbsspjqoysZP3o1GITauJXIkldHCNd)2VRKmXYGDE7Wjt7TzANeJEz1Qv7UppAXXYWQVLjc(b3Y03YSqoJQ5kBzo1Y0r8FOZXm6clZJ6EvhlZRPmhm7qK9nom6mlZdDj3DhI5SAyFk1LtGMUT7Or(yUv79lvRwXkLQuTM4F1nkynA)sfTmxE)aQuVQrDJ81QvVEX8vlxsmayTrE2tOSlOepqNA2Qt)w9wVYnPUugOuDmS6K3Qtb5plk)zjrJInXmKnw0LzaZ1YCcNpZ)3o4GfOX0Ce6bDwEMF3l(Js3DamcKnNq98f7sFoIXvMbIhj8PrWJ(tKpdFIZiJhJz(Q1V)9niFC5mmiVagcevW145ypUzWOrKBTmh0SHz)bM9B0dgOShlZtWix(eqhfRL5mx0sqoGUJDDp1XxT6o4Rbj0xk5tAD2fTV8SiHFbdlfU5fTodA2dnfhonXKmNqx01dgT83nGT5CSOVaViDwUNCi(FlWt1VjY1vztMJ7Rg25uhWwUVrEXyTPUbt9mv2xdHDIJzEi3pb2eWmc286Wk4JpJmf2uxlKhzmOe9o94tGDoJYrC54YBzo)(5yz6srshnIh4Qfmt840aWz6E7oYvyZ2SzWyzVvJ2UiF)TAfuQbQEaTIj0)nhXiLRWwTpB(SuwEhcC6AdTSCRUyuxCk7IcBVni3T1GfNIHXy6E8gspEdPhVH0JppeRYfrmKPiowS78TH1rE8OIyeTPEQLZy4m287bigE1W2bUURgE1ecmntgEmS5vEAolbFjIT6OiCQMcDuEujpA7uwKvG4OMqVJwRaHgW1HsHbfEupHyHqdXagOA0hBt9ahDtmYhdbsyVXq4aSXKn0pAIWUBkI4Tdf39b17ibkpWxefwatCezSkweEgSgE82G7fCmA2RXrNEPPY6DfXriYYRnYHPf7yurS8tNlsiyKlFoqKCQ99bm1YxmpearG0ZhZqlyRgU)QHG3fhu2arRL(du39MN9OJ)(NHn
@adamsp
adamsp / PagedList.kt
Created Oct 10, 2017
Paging Lib Blog PagedList.kt
View PagedList.kt
val mainHandler = Handler(Looper.getMainLooper())
val pagedList = PagedList.Builder<Int, Screenshot>()
.setDataSource(dataSource)
.setMainThreadExecutor({ mainHandler.post(it) })
.setBackgroundThreadExecutor(diskExecutor)
.setConfig(PagedList.Config.Builder()
.setPageSize(8)
.setEnablePlaceholders(true)
.build())
@adamsp
adamsp / MainActivity.kt
Last active Oct 10, 2017
Paging Lib Blog MainActivity.kt
View MainActivity.kt
var screenshotLoader: ScreenshotLoader? = null
var adapter: ScreenshotPickerAdapter? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
screenshotLoader = SAFScreenshotLoader(contentResolver, diskExecutor)
adapter = ScreenshotPickerAdapter(this)
val recycler = findViewById(R.id.main_recycler) as RecyclerView?
recycler?.layoutManager = GridLayoutManager(this, 2)
@adamsp
adamsp / gist:44b075f40ed5ff4e3ca7
Created Mar 10, 2015
Pull DB from Android device
View gist:44b075f40ed5ff4e3ca7
adb shell "run-as com.your.app.package chmod 666 /data/data/com.your.app.package/databases/yourDbName.db"
adb pull /data/data/com.your.app.package/databases/yourDbName.db
@adamsp
adamsp / update.sh
Created Feb 11, 2014
Simple bash script for updating & deploying an Octopress site, and committing your changes to git. Usage: "./update.sh This is your commit message"
View update.sh
#!/bin/bash
ERR_SITE_GEN=1
ERR_SITE_DEPLOY=2
ERR_GIT_ADD=3
ERR_GIT_COMMIT=4
ERR_GIT_PUSH=5
ERR_NO_COMMIT_MESSAGE=6
if [ $# -eq 0 ]; then
@adamsp
adamsp / update.sh
Created Feb 5, 2014
Simple script to update my Octopress blog and push changes to git in one go. Now I type one command instead of 5!
View update.sh
#!/bin/bash
ERR_SITE_GEN=1
ERR_SITE_DEPLOY=2
ERR_GIT_ADD=3
ERR_GIT_COMMIT=4
ERR_GIT_PUSH=5
ERR_NO_COMMIT_MESSAGE=6
if [ $# -eq 0 ]; then
@adamsp
adamsp / MainActivity.java
Created Dec 16, 2013
Date formatting inconsistencies on Android. Varies across locales, Date format settings, devices, and presumably across Android versions too.
View MainActivity.java
package com.example.dtmformattingexamples;
import java.util.Date;
import java.util.Locale;
import android.app.Activity;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.widget.TextView;
@adamsp
adamsp / GsonRequest.java
Created Nov 25, 2013
A Volley request class for easy parsing of JSON using Gson.
View GsonRequest.java
/**
* Copyright 2013 Adam Speakman
*
* 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
@adamsp
adamsp / TextViewLinkHider.java
Created Oct 28, 2013
If you've got a TextView with clickable links setup using HTML and LinkMovementMethod ( http://stackoverflow.com/questions/2734270/how-do-i-make-links-in-a-textview-clickable/2746708#2746708 ), this class allows you to hide either the underlines or the entire link - useful, for example, if you're showing tweets and need to link to profiles etc.
View TextViewLinkHider.java
/**
* Copyright 2013 Adam Speakman
*
* 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
@adamsp
adamsp / DreamLinkMovementMethod.java
Last active Dec 26, 2015
How to create clickable links from TextViews within a DreamService.
View DreamLinkMovementMethod.java
/**
* Copyright 2013 Adam Speakman
*
* 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