Skip to content

Instantly share code, notes, and snippets.

let cols = 5; //columns in the grid
let rows = 5; //rows in the grid
let grid = new Array(cols); //array of all the grid points
let openSet = []; //array containing unevaluated grid points
let closedSet = []; //array containing completely evaluated grid points
let start; //starting grid point
let end; // ending grid point (goal)
@RanjanSushant
RanjanSushant / Task.js
Created April 7, 2022 13:31
Codesphere React Native ToDo App Task component
import React from "react";
import { View, Text, StyleSheet } from "react-native";
function Task(props) {
return (
<View style={styles.item}>
<View style={styles.itemLeft}>
<Text style={styles.itemText}>{props.text}</Text>
</View>
</View>
@RanjanSushant
RanjanSushant / App.js
Created April 7, 2022 13:28
Codesphere React Native Demo ToDo App
import React from "react";
import {
KeyboardAvoidingView,
StyleSheet,
Text,
View,
TextInput,
TouchableOpacity,
Keyboard,
ScrollView,
@RanjanSushant
RanjanSushant / audience.html
Created March 9, 2022 14:07
Audience for Twilio Livestream Demo Codesphere
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script defer src="../livePlayer/twilio-live-player.min.js"></script>
<script defer src="audience.js" type="text/javascript"></script>
<title>Twilio Livestream | Audience</title>
</head>
@RanjanSushant
RanjanSushant / streamer.html
Created March 9, 2022 14:00
Streamer for the Twilio Livestream Demo Codepshere
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script
defer
src="https://sdk.twilio.com/js/video/releases/2.18.0/twilio-video.min.js"
></script>
@RanjanSushant
RanjanSushant / index.html
Created March 9, 2022 13:55
Index HTML file for Twilio Livestream Demo Codesphere
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Twilio Livestream Demo | Codesphere</title>
</head>
<body>
<h1>Twilio Livestream Demo</h1>
@RanjanSushant
RanjanSushant / server.js
Last active March 9, 2022 14:03
Server for Twilio Livestream Demo Codesphere
import dotenv from "dotenv";
import { fileURLToPath } from "url";
import { dirname } from "path";
import express from "express";
import crypto from "crypto";
import twilio from "twilio";
dotenv.config();
const __filename = fileURLToPath(import.meta.url);
@RanjanSushant
RanjanSushant / Dockerfile
Created March 1, 2022 16:34
Dockerfile for Codesphere Docker demo
FROM node:17.6-alpine
WORKDIR /home/demo_app/
COPY package.json package.json
RUN npm install
COPY ./demo_app .
@RanjanSushant
RanjanSushant / index.html
Created March 1, 2022 15:06
Application for Codesphere Docker demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Docker Demo</title>
</head>
<body>
<h1>To Do List</h1>
@RanjanSushant
RanjanSushant / graphql_server_demo.js
Created February 15, 2022 04:58
Codesphere GraphQL server demo
import express from "express";
import { graphqlHTTP } from "express-graphql";
import { buildSchema } from "graphql";
//Images data
const imagesData = [
{
id: 1,
title: "Stacked Brwonies",