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
// original from: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/ | |
// original gist: https://gist.github.com/willpatera/ee41ae374d3c9839c2d6 | |
function doPost(e){ | |
return handleResponse(e); | |
} | |
function doGet(e){ | |
return handleResponse(e); | |
} |
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
def propertiesFile = project.rootProject.file('local.properties') | |
if (propertiesFile.exists()) { | |
Properties properties = new Properties() | |
properties.load(propertiesFile.newDataInputStream()) | |
ext.SECRET_KEY = properties.getProperty('SECRET_KEY') ?: "" | |
} else { | |
ext.SECRET_KEY = System.getenv('SECRET_KEY') ?: "" | |
} |
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
//Saving scroll state | |
val position = linearLayoutManager.findFirstVisibleItemPosition() | |
val offset = linearLayoutManager.getChildAt(0).let { | |
if (it == null) 0 else it.top - linearLayoutManager.paddingTop | |
} | |
postFeedViewModel.scrollState = ScrollState.of(position, offset) | |
//Restoring scroll state | |
val scrollState = postFeedViewModel.scrollState | |
linearLayoutManager.scrollToPositionWithOffset(scrollState.position, scrollState.offset) |