Skip to content

Instantly share code, notes, and snippets.

View rbhatia46's full-sized avatar

Rahul Bhatia rbhatia46

  • Bengaluru
View GitHub Profile
@rbhatia46
rbhatia46 / Header.js
Created December 15, 2017 14:44
Reusable Header Component for React Native
import React from 'react';
import { View, Text } from 'react-native';
const Header = (props) => {
return (
<View style={styles.viewStyle}>
<Text style={styles.textStyle}>{props.headerText}</Text>
</View>
);
};
@rbhatia46
rbhatia46 / SnakePython.py
Created November 6, 2017 14:19
Snake game in Python
import random
import curses
s = curses.initscr()
curses.curs_set(0)
sh, sw = s.getmaxyx()
w = curses.newwin(sh, sw, 0, 0)
w.keypad(1)
w.timeout(100)
@rbhatia46
rbhatia46 / MongoCommands.md
Last active December 20, 2017 12:23
MongoDB Basic Commands

MongoDB Basic Commands

show dbs //Shows all the databases
use facenovel //Creates and switches to a new database called facenovel
@rbhatia46
rbhatia46 / MongoCommands.md
Created October 19, 2017 03:22
MongoDB Basic Commands

#MongoDB Basic Commands

show dbs //Shows all the databases
use facenovel //Creates ans switches to a new database called facenovel
@rbhatia46
rbhatia46 / Neural Network in Synaptic.js
Created October 11, 2017 19:22
A simple neural network to solve the XOR Equation using Synaptic.js written in Javascript.
const { Layer, Network } = window.synaptic;
var inputLayer = new Layer(2);
var hiddenLayer = new Layer(3);
var outputLayer = new Layer(1);
inputLayer.project(hiddenLayer);
hiddenLayer.project(outputLayer);
var myNetwork = new Network({
input: inputLayer,
hidden: [hiddenLayer],
@rbhatia46
rbhatia46 / Bare Minimum Git Commands to get started.md
Last active October 3, 2017 16:58
Includes Basic Git commands for a beginner

Bare Minimum Git Commands to get started

$ git init 
$ git add .
$ git commit -m "Commit Message"
$ git status
$ git log --oneline
$ git checkout #commitid (fileName) //Revert back to a commit
$ git remote add origin {url}
@rbhatia46
rbhatia46 / SQL-Social-Network.sql
Created September 18, 2017 12:09
My answers to SQL exercises for db-class.org /Part 2/
/* Delete the tables if they already exist */
drop table if exists Highschooler;
drop table if exists Friend;
drop table if exists Likes;
/* Create the schema for our tables */
create table Highschooler(ID int, name text, grade int);
create table Friend(ID1 int, ID2 int);
create table Likes(ID1 int, ID2 int);
@rbhatia46
rbhatia46 / signature.html
Created September 3, 2017 21:15
Email Signature
<div style="font-family: 'Roboto', sans-serif;font-weight:bold;color:#073763;">
</span>
<div style="float:left; border-left:4px solid #073763; padding-left:20px; margin-left:6px;height:140px">
<h1 style="font-size: 20px;margin:2px">Rahul Bhatia</h1>
<h4 style="font-size: 14px;margin:4px">Web Developer</h4>
<h4 style="font-size: 14px;margin:4px">Microsoft Student Partner 2017-2018</h4>
<h4 style="font-size: 14px;margin:4px">Sophomore, The LNM Institute of Information Technology</h4>
@rbhatia46
rbhatia46 / fb-dl.py
Created July 11, 2017 14:40 — forked from zmwangx/fb-dl.py
Scrape all photos from a public Facebook page.
#!/usr/bin/env python
############################### README ###############################
# External dependencies:
# * libmagic
# * python-dateutil
# * python-magic
# * requests
#
# The shell command call at the end was tested with GNU date from GNU