Skip to content

Instantly share code, notes, and snippets.

:octocat:
Productive

Aravind Vemula vemarav

:octocat:
Productive
Block or report user

Report or block vemarav

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vemarav
vemarav / scrollview_vs_flatlist_vs_recycler_list_view.md
Last active Oct 7, 2019
Comparison of react native ScrollView vs FlatList vs RecyclerListView
View scrollview_vs_flatlist_vs_recycler_list_view.md

Memory consumed by FlatList and RecyclerListView is similar, RecyclerListView wins over UI glitches as for large data sets glitches may observed in FlatList

No ScrollView FlatList RecyclerListView
1 No Memory Management Automatic Memory Management Automatic Memory Management (Similar to FlatList)
2 Loads All content at once Loads content as window scrolled Loads content as window scrolled
3 Scroll position is not preserved if data refreshed Scroll position is not preserved if data refreshed Scroll is preserved if data refreshed
4 Observable frame drops Observable frame drops for large data sets (> 1500) No frame drops, Highly Performant
5 Trouble refreshing data Trouble refreshing data Easy to refresh/update data
6 Available in react native import {ScrollView} from 'react-native' Available in react native import {FlatList} from 'react-native' Available via third-party module ` import { RecyclerListView, DataProvider, LayoutProvider } from "r
@vemarav
vemarav / background-timer.js
Last active Jun 28, 2019
solution for BackgroundTimer setInverval not working in app background
View background-timer.js
// file: ./BackgroundTimer.js
import { DeviceEventEmitter, NativeAppEventEmitter, Platform } from 'react-native';
import _BackgroundTimer from 'react-native-background-timer'; // v2.1.1
const EventEmitter = Platform.select({
ios: () => NativeAppEventEmitter,
android: () => DeviceEventEmitter,
})();
class BackgroundTimer {
View dir-structure
app-root
|_ src
| |_ models
| |_ User.js
| |_ index.js
|_ server.js
|_ console.js
|_ package.json
|_ yarn.lock
@vemarav
vemarav / console.js
Last active Dec 2, 2018
Build rails like console in nodejs
View console.js
/**
* add console.js at ther root of your app
* Modify to make it more helpful for your project
* > Note: `esm` adds ES6 support in Node
* In package.json
* ...
* "scripts": {
* "start": "nodemon -r esm ./server.js"
* "console": "node -r esm --experimental-repl-await console",
* }
@vemarav
vemarav / .eslintrc.json
Last active Nov 21, 2018
.eslintrc.json
View .eslintrc.json
{
"extends": ["airbnb-base", "prettier"],
"plugins": ["prettier"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"impliedStrict": true
}
View tips.js
const foo = {name: 'Foo', age: 16, nervous: false};
const bar = {name: 'Bar', age: 18, nervous: false};
const baz = {name: 'Baz', age: 20, nervous: true};
// Bad code
// Debugging with console.log
console.log(foo);
console.log(bar);
console.log(baz);
@vemarav
vemarav / 42-things.md
Created Sep 3, 2018 — forked from xdite/42-things.md
Ten (42) Things You Didn't Know Rails Could Do
View 42-things.md
@vemarav
vemarav / animatedScrollTo.js
Created Aug 15, 2018 — forked from andjosh/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
View animatedScrollTo.js
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@vemarav
vemarav / note_form.dart
Created May 9, 2018
2.02_add_bottom_app_bar-Solution gist for https://github.com/Aravind99/keeper
View note_form.dart
import 'package:flutter/material.dart';
class NoteForm extends StatefulWidget {
static String routeName = 'noteForm';
@override
State<StatefulWidget> createState() {
return new _NoteFormState();
}
}
View commit_message_convention.md

Commit message convention We prefix our commit messages with one of the following to signify the kind of change:

fix: bug fixes, e.g. fix Button color on DarkTheme.

feat: new features, e.g. add Snackbar component.

refactor: code/structure refactor, e.g. new structure folder for components.

docs: changes into documentation, e.g. add usage example for Button.

You can’t perform that action at this time.