This file contains hidden or 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 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() |
This file contains hidden or 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 { 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') |
This file contains hidden or 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
| <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" /> |
This file contains hidden or 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 loadingState = ViewState.create(R.layout.view_state_loading) |
This file contains hidden or 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
| 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 | |
| } | |
| } |
This file contains hidden or 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 stateLayout = findViewById<StateLayout>(R.id.state_layout) | |
| stateLayout.showState(loadingState) | |
| ... | |
| stateLayout.showState(contentState) |
This file contains hidden or 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 transition = TransitionInflater.from(context) | |
| .inflateTransition(android.R.transition.slide_left) | |
| transition.duration = 500 | |
| stateLayout.showState(contentState, transition) |
This file contains hidden or 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
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: Stack to create new S3 bucket | |
| Resources: | |
| myUniqueBucket: | |
| Type: AWS::S3::Bucket | |
| Properties: | |
| BucketName: 'my-unique-bucket-name' |
This file contains hidden or 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 read_characters(string): | |
| for char in string: | |
| print(f"Yield char {char}...") | |
| yield char | |
| content = read_characters(input_string) | |
| print(content) |
This file contains hidden or 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
| 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) |