Skip to content

Instantly share code, notes, and snippets.

View dkhmelenko's full-sized avatar

Dmytro Khmelenko dkhmelenko

View GitHub Profile
val credential = Credential.Builder(login)
.setName(login)
.setPassword(password)
.build()
RxGoogleSmartLockManager.deleteStoredCredentials(context, credential)
.subscribe({
Toast.makeText(this, "Deleted credential successfully", Toast.LENGTH_SHORT).show()
}, {
Toast.makeText(this, "Failed deleting credential: $it", Toast.LENGTH_SHORT).show()
import { Application } from 'probot'
import { PullRequestsCreateReviewParams } from '@octokit/rest'
export = (app: Application) => {
app.on(['pull_request.opened', 'pull_request.labeled'], async (context) => {
const pullRequest = context.payload.pull_request
const hasShiptItLabel: string[] = pullRequest.labels
.map((label: any) => label.name)
.includes('shipit')
<com.freeletics.statelayout.StateLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/state_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
val loadingState = ViewState.create(R.layout.view_state_loading)
class BindableContent(val text: String) : ViewState.Inflatable(R.layout.view_state_content) {
override fun onBindView(view: View) {
val textView = view.findViewById<TextView>(R.id.text)
textView.text = text
}
}
val stateLayout = findViewById<StateLayout>(R.id.state_layout)
stateLayout.showState(loadingState)
...
stateLayout.showState(contentState)
val transition = TransitionInflater.from(context)
.inflateTransition(android.R.transition.slide_left)
transition.duration = 500
stateLayout.showState(contentState, transition)
AWSTemplateFormatVersion: '2010-09-09'
Description: Stack to create new S3 bucket
Resources:
myUniqueBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: 'my-unique-bucket-name'
def read_characters(string):
for char in string:
print(f"Yield char {char}...")
yield char
content = read_characters(input_string)
print(content)
reviews = [3.2, 1.1, 5.0, 4.4, 3.9, 4.8, 2.8, 4.1, 3.6]
top_reviews = [review for review in reviews if review > 4.0]
print(top_reviews)