Skip to content

Instantly share code, notes, and snippets.

View renganatha10's full-sized avatar

Renganatha Arunachalam renganatha10

  • Bangalore
View GitHub Profile
@renganatha10
renganatha10 / AccessReactSubView.m
Last active October 17, 2024 10:38
Basic Native UI component Bridging Code
//RCTListViewManger.h
#import <UIKit/UIKit.h>
@interface RCTNativeListView : UIView
@property (nonatomic) NSArray * colors;
@end
--------------------------------------------------------------------------------
//RCTListViewManger.m
@renganatha10
renganatha10 / NativeManager.java
Created February 22, 2017 17:54
Set of Example for Bridging android native Modules in React Native
package com.musicapp;
import android.annotation.TargetApi;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
function main(input) {
input=input.split(/\s+/);
var output = 1;
var init = input[1];
for(var i = 1; i < input[0]; i++){
if(temp < input[i + 1] ){
output++;
}
temp = input[i + 1];
}
@renganatha10
renganatha10 / sw.js
Created April 26, 2017 17:19
Basic service worker configuration
const CACHE_NAME = 'whatsappweb-cache-v9';
const { assets } = global.serviceWorkerOption;
const urlsToCache = ['./', './index.html', ...assets];
self.addEventListener('install', event => {
console.log('Service Woker Started');
event.waitUntil(
caches.open(CACHE_NAME).then(cache => {
console.log('Opened cache');
@renganatha10
renganatha10 / code_setting.json
Created June 7, 2018 06:12
Vscode User Settings
{
"git.enableSmartCommit": true,
"emmet.syntaxProfiles": {
"javascript": "jsx"
},
"editor.fontFamily": "Avenir Light, Monaco, 'Courier New', monospace",
"editor.fontSize": 13,
"eslint.enable": true,
"eslint.autoFixOnSave": true,
[
{
"title": "100",
"symbol": "💯",
"keywords":
"hundred points symbol symbol wow wow win win perfect perfect parties parties"
},
{
"title": "1234",
"symbol": "🔢",
@renganatha10
renganatha10 / composed-graphql-using-commonhoc.js
Last active November 21, 2018 18:58
Multiple graphql composed in single component using common Higher order component
import React, { PureComponent } from 'react';
import { View, Text } from 'react-native';
// No Need to Import Loading and error component every where
import withCommonQuery from './hoc/withCommonQueries';
import GET_LINEITEMS from './query/LineItem/GET_LINEITEMS';
import GET_DELIVERABLE_LIST from './query/Deliverables/GET_DELIVERABLE_LIST';
import GET_PROJECTROLE from './query/ProjectRoles/GET_PROJECTROLE';
class Dummy extends PureComponent {
@renganatha10
renganatha10 / common-graphql-hoc.js
Created November 21, 2018 18:14
Common GraphQL HOC to handle Common Error and Loading state and its component
import React from 'react';
import { graphql, compose } from 'react-apollo';
// Common Loading Component
import LoadingComponent from './../components/Loader';
// Common Error Component
import ErrorComponent from './../components/ErrorComponent';
const withCommonQueries = ({ queries }) => SuccessComponent => {
const CommonQueryComponent = props => {
try {
@renganatha10
renganatha10 / usual-compose-graphql.js
Created November 21, 2018 18:54
With usual Compose and GraphQL from react apollo
import React, { PureComponent } from 'react';
import { View, Text } from 'react-native';
import { graphql, compose } from 'react-apollo';
import ErrorComponent from './components/ErrorComponent';
import LoadingComponent from './components/Loader';
import GET_LINEITEMS from './query/LineItem/GET_LINEITEMS';
import GET_DELIVERABLE_LIST from './query/Deliverables/GET_DELIVERABLE_LIST';
import GET_PROJECTROLE from './query/ProjectRoles/GET_PROJECTROLE';
{
"parser": "babel-eslint",
"env": {
"browser": false,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",