Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View evasyuk's full-sized avatar

Yevhenii Vasiuk evasyuk

View GitHub Profile
@emmanuelnk
emmanuelnk / koa-context.ts
Last active June 7, 2022 16:32
Simple Koa Context for testing in Typescript (Mocha-chai, Jest) etc
/* eslint-disable @typescript-eslint/ban-ts-comment */
// @ts-nocheck
// Ripped from https://github.com/koajs/koa/blob/master/test/helpers/context.js
// Solution courtesy of user @fl0w. See: https://github.com/koajs/koa/issues/999#issuecomment-309270599
// I've disabled type checking in this file but you are free to add types if you wish
// if you want more comprehensive Koa Context object to test stuff like Cookies etc
// then use https://www.npmjs.com/package/@shopify/jest-koa-mocks (requires Jest)
@blankg
blankg / WebViewBridge.js
Last active July 12, 2022 06:53
For RN >= 0.57 please look at https://github.com/blankg/rn-webview-bridge-sample-new/blob/master/resources/index.html. Provides a sample implementation for sending and receiving messages to and from the React-Native WebView (using postMessage/onMessage WebView API).
/**
* Created by Guy Blank on 3/9/17.
*
* This is a sample provides an API to send & receive messages to and from the React-Native WebView (using postMessage/onMessage WebView API).
* A sample project that uses the bridge is available here https://github.com/blankg/rn-webview-bridge-sample
*
* webViewBridge.send('functionToInvoke', {mydata: 'test'}, function(){console.log('success')},function(){console.log('error')});
*
* The API is designed to be similar to the Cordova exec API so migration to it should be almost seamless.
* The API also provides solution to a React-Native WebView bug in iOS which causes sending consecutive postMessage calls to override each other.
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", "
@tahmidsadik
tahmidsadik / purgeAndroid.txt
Created September 19, 2015 18:47
How to completely remove Android Studio from Mac OS X
How to Completely Remove Android Studio
Execute these commands from the terminal
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
@gabrielemariotti
gabrielemariotti / README.md
Last active March 9, 2023 06:02
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

/**
* A string builder with built-in support for ANSI escape sequences.
*
* @author Nathan Fiscaletti
*/
public class AnsiStringBuilder
{
/**
* Reset options.
*/
@rogerpujol
rogerpujol / Android Value Animator Example.java
Last active June 20, 2018 09:47
Example that shows how to implement a Value Animator
/**
* ValueAnimator can be type of: ofInt, ofFloat, ofObject, etc...
* Check for more info: http://developer.android.com/reference/android/animation/ValueAnimator.html
* and http://developer.android.com/guide/topics/graphics/prop-animation.html
*/
public ValueAnimator va = ValueAnimator.ofInt(0, 300);
public int mDuration = 3000; //in millis
va.setDuration(mDuration);
va.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator animation) {
public class customViewGroup extends ViewGroup {
public customViewGroup(Context context) {
super(context);
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
}
@gnuanu
gnuanu / 01.step1.md
Last active January 24, 2024 08:20
Creating a simple Hello World application Using Android NDK with C++

Prerequisites

  1. I am using GNU/Linux
  2. My IDE is IntelliJ IDEA
  3. The project is Ant based.
  4. My working directory is $JNI
  5. My C++ IDE is QtCreator (I'll mention the build steps inline).
  6. NDK should be installed and ndk-build should be available in $PATH
  7. javah should be available in $PATH

Step 1 - Create The Android Project

@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)