Skip to content

Instantly share code, notes, and snippets.

View evasyuk's full-sized avatar

Yevhenii Vasiuk evasyuk

View GitHub Profile
@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');
@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 / .txt
Created October 11, 2018 12:10
binary
temp.binary
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 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
// 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 September 6, 2016 12:00 — forked from gabrielemariotti/README.md
A SectionedGridRecyclerViewAdapter: use this class to realize a simple sectioned grid `RecyclerView.Adapter`.

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 July 2, 2016 15:54
high ping bug, system information
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Laptop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Family: 0x6
CPU Model: 0x3c
#!/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"
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)
}