Skip to content

Instantly share code, notes, and snippets.

View harrybanda's full-sized avatar

Harry Banda harrybanda

View GitHub Profile
@harrybanda
harrybanda / BookDialog.js
Created September 21, 2021 14:02
BookDialog.js
import ForgeUI, { ModalDialog, Form, TextField } from "@forge/ui";
export const BookDialog = ({ books, setBooks, isOpenModal, setOpenModal }) => {
const onSubmit = async (formData) => {
setBooks([...books, formData]);
setOpenModal(false);
};
return (
isOpenModal && (
import ForgeUI, {
Fragment,
Text,
Table,
Head,
Row,
Cell,
Button,
ButtonSet,
} from "@forge/ui";
@harrybanda
harrybanda / jsx
Created September 21, 2021 13:49
import ForgeUI, {
Fragment,
Text,
Table,
Head,
Row,
Cell,
Button,
ButtonSet,
} from "@forge/ui";
import ForgeUI, {
Fragment,
Text,
Table,
Head,
Row,
Cell,
Button,
ButtonSet,
} from "@forge/ui";
<Rave
amount={route.params.amount}
country="NG"
currency="ZMW"
paymentOption="card,mobilemoneyzambia"
email={route.params.email}
phone={route.params.phone}
firstname={route.params.fname}
lastname={route.params.lname}
publickey=""
const AWS = require("aws-sdk");
const fs = require("fs");
const sageMakerRuntime = new AWS.SageMakerRuntime({
region: "us-east-1",
accessKeyId: "XXXXXXXXXXXXXXXXXXXXXXXXXXXX",
secretAccessKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
});
const bitmap = fs.readFileSync("sample.jpeg");
<!DOCTYPE html>
<html>
<body ng-app="myApp" ng-controller="MainController">
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.0.8/es5-shim.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?libraries=geometry,places,language,drawing&key=AIzaSyAyxQeTDA0nVljW82CpgZR7G5siEq5eiuU"></script>
<script id="jsbin-javascript">
/* jshint esnext: true */
let app = angular.module('myApp', []);
@harrybanda
harrybanda / level-updates.js
Created February 24, 2019 10:27
Virtual Coder Level Handing
function update(args, ctx) {
var area = 0.05; // Area for robot to stand on
var yOffset = 0.22; // Offset on the Y axis
var py = 0.21; // Y position on 3D space
// Check if robot has reached the on goal
if (isBetween(ctx.entity.getTranslation().x, ctx.goalx + area, ctx.goalx - area)
&& isBetween(ctx.entity.getTranslation().z, ctx.goalz + area, ctx.goalz - area)
&& ctx.entity.getTranslation().y === py) {
ctx.entity.setTranslation(ctx.goalx, yOffset, ctx.goalz);
@harrybanda
harrybanda / block_editor.html
Last active February 24, 2019 10:14
Virtual Coder Block Editor HTML code
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hack-font@3/build/web/hack-subset.css">
<div id="hider"><div class="srnTitle">VIRTUAL CODER</div></div>
<div id="headers">
<div id="toolbox-h">Toolbox</div>
<div id="workspace-h">
Workspace: