This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.joda.time.DateTime; | |
import org.joda.time.DateTimeZone; | |
public class WCFDateTimeParser { | |
/** | |
* <p>WCF services supply Dates over JSON in a strange format. This method | |
* takes a WCF-formatted Date string and parses it into a JodaTime DateTime | |
* object. Assumes valid input matching a format described below.</p> | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
OlderNewer