Skip to content

Instantly share code, notes, and snippets.

// custom dialog
final Dialog dialog = new Dialog(context);
dialog.setContentView(R.layout.custom);
dialog.setTitle("Title...");
// set the custom dialog components - text, image and button
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("Android custom dialog example!");
ImageView image = (ImageView) dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.ic_launcher);
@evasyuk
evasyuk / txt
Created February 28, 2017 13:38
React Native, from zero to hero task series Part 0
1. Implement simple demo
- button "left"
- button "right"
- text view
- define cyclic list of 5 text-items
- on button press change text-item to next one
2. Implement timer
- button left
- button right
- timer text view
cd ${bamboo.build.working.directory}
if ls **/test-results/*.xml 1> /dev/null 2>&1; then
curl -H "Authorization: token <your_githib_api_token>" --request POST --data '{"state": "success", "context": "build", "description": "Build Passed", "target_url": "${bamboo.buildResultsUrl}"}' https://api.github.com/repos/<username>/<repo_name>/statuses/${bamboo.repository.revision.number} > /dev/null
else
curl -H "Authorization: token <your_githib_api_token>" --request POST --data '{"state": "failure", "context": "build", "description": "Build Failed!", "target_url": "${bamboo.buildResultsUrl}"}' https://api.github.com/repos/<username>/<repo_name>/statuses/${bamboo.repository.revision.number} > /dev/null
fi
##check for test failures.
if (grep 'failure message' **/test-results/*.xml 1> /dev/null 2>&1) then
mainJunit=$(find **/test-results/*.xml -print0 | xargs -0 grep 'failure message' | wc -l)
curl -H "Authorization: token <your_githib_api_token>" --request POST --data '{"state": "failure", "context": "tests", "
@evasyuk
evasyuk / .txt
Created October 11, 2018 12:10
binary
temp.binary
@evasyuk
evasyuk / add babel support
Created April 5, 2021 08:54
Add babel support to index.js
.babelrc
############################################################
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
@evasyuk
evasyuk / gist:e05c230afa578fe42f95e4d8b004356f
Created January 28, 2022 21:35
react-native: intl for default Android JS engine
/**
* Set Intl variable for Android OS
*/
if (!global.Intl) {
require('intl');
require('intl/locale-data/jsonp/en.js');
// Used mostly common locales for date time
require('intl/locale-data/jsonp/en-GB.js');
require('intl/locale-data/jsonp/en-US.js');
require('intl/locale-data/jsonp/en-AU.js');