Skip to content

Instantly share code, notes, and snippets.

View vemarav's full-sized avatar
👨‍💻
Productive

Aravind Vemula vemarav

👨‍💻
Productive
View GitHub Profile
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 September 3, 2018 05:46 — forked from xdite/42-things.md
Ten (42) Things You Didn't Know Rails Could Do
@vemarav
vemarav / animatedScrollTo.js
Created August 15, 2018 14:58 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
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 18:21
2.02_add_bottom_app_bar-Solution gist for https://github.com/Aravind99/keeper
import 'package:flutter/material.dart';
class NoteForm extends StatefulWidget {
static String routeName = 'noteForm';
@override
State<StatefulWidget> createState() {
return new _NoteFormState();
}
}
@vemarav
vemarav / commit_message_convention.md
Created May 9, 2018 16:50
Commit Message Convention

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.

@vemarav
vemarav / open_emulator_from_command line.md
Last active May 9, 2018 05:11
Open android emulator from command line or Open android simulator from command line
  1. Paste the following scipt in your .bashrc file if they doesn't exist.
# ~/.bashrc

export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
// file location:
// node_modules/react-native/local-cli/server/util/debuggerWorker.js
var messageHandlers = {
'executeApplicationScript': function(message, sendReply) {
for (var key in message.inject) {
self[key] = JSON.parse(message.inject[key]);
}
importScripts(message.url);
sendReply();
}
@vemarav
vemarav / home_page.dart
Last active November 10, 2020 06:19
Flutter Authentication Flow
import 'dart:async';
import 'package:auth_flow/app/utils/auth_utils.dart';
import 'package:auth_flow/app/utils/network_utils.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
class HomePage extends StatefulWidget {
static final String routeName = 'home';
@override
@vemarav
vemarav / auth_utils.dart
Last active March 9, 2022 13:23
Flutter Authentication Fllow
import 'package:shared_preferences/shared_preferences.dart';
class AuthUtils {
static final String endPoint = '/api/v1/auth_user';
// Keys to store and fetch data from SharedPreferences
static final String authTokenKey = 'auth_token';
static final String userIdKey = 'user_id';
static final String nameKey = 'name';
@vemarav
vemarav / network_utils.dart
Last active January 18, 2019 18:50
Flutter Authentication Flow
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:http/http.dart' as http;
import 'auth_utils.dart';
class NetworkUtils {
static final String host = productionHost;
static final String productionHost = 'https://authflow.herokuapp.com';
static final String developmentHost = 'http://192.168.31.110:3000';