Skip to content

Instantly share code, notes, and snippets.

View vasyl91's full-sized avatar

Hubert vasyl91

  • Poznań
View GitHub Profile
// Based on example written by: Cory J. Fowler
#include <mcp_can.h>
#include <SPI.h>
unsigned long rxId;
unsigned long rxIdToBlock = 0x128; // in my case it is the same for every rxBlock
byte len;
byte rxBuf[8];
@vasyl91
vasyl91 / CSVGraph.java
Created February 2, 2019 21:39
GraphView React-Native CSV reader module
import android.graphics.Color;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.facebook.react.uimanager.SimpleViewManager;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.annotations.ReactProp;
import com.jjoe64.graphview.GraphView;
import com.jjoe64.graphview.GridLabelRenderer;
@vasyl91
vasyl91 / ReactNativeHomeButton.java
Last active September 27, 2018 09:46
Native module that simulates / programmatically presses Home button in React Native
//Create Native module and paste this code. Then in js call it with: YourClassName.launchHome();
//add <category android:name="android.intent.category.HOME"/> to AndroidManifest.xml (paste between "MAIN" and "LAUNCHER")
import android.content.Intent;
import android.content.Context;
public class YourClassName extends ReactContextBaseJavaModule {
@ReactMethod
public void launchHome() {