Skip to content

Instantly share code, notes, and snippets.

@GuyARoss
GuyARoss / review.md
Created June 29, 2020 06:53
Code Review - Javascript Calculator

app.js

I might try to avoid having these global variables, lets look into why we need them.

let prevResult = null;
let currentOperation;

So it looks like we are reassigning prevResult in the executeOperation method within the Calculator class. Do we reassign elsewhere? Ah so we do it as part of our clear procedure.. so I guess the first thing I would do here is rather than just doing these reassignments globally. So maybe an approach here would be to move the prevResult global variable as a property of the Calculator class. Then using the constructor to set the default value to undefined.

@GuyARoss
GuyARoss / Review.md
Created June 30, 2020 02:01
Review V2

Review

I have a little bit more time here today, so it hopefully will be a little more helpful.

Readme.md

How do I run your application? How can I contribute to your application? Pimp out this readme! Here is a repo of templates for you to use.

index.html

Woah! that is a lot of buttons, is there any way that we can automate the process of rendering these? outside of that, your semantics look good!

@GuyARoss
GuyARoss / main.js
Created August 9, 2020 08:22
stripe noise thing
import {_ as e, L as t} from "./index-4deec983.js";
import {a as n, C as i} from "./Controller-26bd1e9e.js";
import {S as s} from "./ScrollObserver-d0732a2c.js";
import {F as o} from "./index-bee741e4.js";
class r {
constructor(e, t, n, i=!1) {
const s = this
, o = -1 !== document.location.search.toLowerCase().indexOf("debug=webgl");
s.canvas = e,
s.gl = s.canvas.getContext("webgl", {
@GuyARoss
GuyARoss / thing.py
Created October 10, 2023 06:07
worst program ever
import sys
import tiktoken
import pinecone
import os
import uuid
import re
import openai
openai.api_key = "#TODO"
encoding = tiktoken.encoding_for_model("gpt-3.5-turbo")
//
// httplib.h
//
// Copyright (c) 2023 Yuji Hirose. All rights reserved.
// MIT License
//
#ifndef CPPHTTPLIB_HTTPLIB_H
#define CPPHTTPLIB_HTTPLIB_H