Skip to content

Instantly share code, notes, and snippets.

Avatar

Yevhenii Vasiuk evasyuk

View GitHub Profile
@evasyuk
evasyuk / gist:e05c230afa578fe42f95e4d8b004356f
Created Jan 28, 2022
react-native: intl for default Android JS engine
View gist:e05c230afa578fe42f95e4d8b004356f
/**
* 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');
@evasyuk
evasyuk / add babel support
Created Apr 5, 2021
Add babel support to index.js
View add babel support
.babelrc
############################################################
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
View .txt
temp.binary
View complete.sh
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 Feb 28, 2017
React Native, from zero to hero task series Part 0
View txt
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
View android dialog
// 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 / README.md
Created Sep 6, 2016 — forked from gabrielemariotti/README.md
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.
View README.md

You can use this class to realize a simple sectioned grid RecyclerView.Adapter without changing your code.

Screen

The RecyclerView has to use a GridLayoutManager.

This is a porting of the class SimpleSectionedListAdapter provided by Google

If you are looking for a sectioned list RecyclerView.Adapter you can take a look here

@evasyuk
evasyuk / system_information from Steam
Created Jul 2, 2016
high ping bug, system information
View system_information from Steam
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Laptop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Family: 0x6
CPU Model: 0x3c
View generate_jni_header.sh
#!/usr/bin/env bash
#
# this script is intend to automize routine of creating file header
# with main aim of avoiding errors
SCRIPT_PATH=`pwd -P`
SUBMODULE="SUBMODULE"a
SRC_PATH="${SCRIPT_PATH}/src"
View build.gradle
import org.apache.tools.ant.taskdefs.condition.Os
def getPlatformNdkBuildCommand() {
def rootDir = project.rootDir
def localProperties = new File(rootDir, "local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream {
instr -> properties.load(instr)
}