This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// See https://chatgpt.com/share/67331281-9cec-800b-99fb-c193630dffa1 | |
const http = require('http'); | |
const { URL } = require('url'); | |
const PORT = 8000; | |
const TARGET_PORT = 65412; | |
const TARGET_HOST = 'localhost'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prototype pollution, part 1 | |
// See https://learning.oreilly.com/library/view/grokking-web-application/9781633438262/OEBPS/Text/11.html#heading_id_10 | |
const food = { | |
munch() { | |
console.log('Eating') | |
}, | |
} | |
const sandwich = { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Edit to taste, e.g. <HostFolder>s and <MemoryInMB> --> | |
<Configuration> | |
<vGpu>Disable</vGpu> | |
<Networking>Disable</Networking> | |
<MappedFolders> | |
<MappedFolder> | |
<HostFolder>C:\Development\cpsc458\tools</HostFolder> | |
<SandboxFolder>C:\Users\WDAGUtilityAccount\Desktop\tools</SandboxFolder> | |
<ReadOnly>true</ReadOnly> | |
</MappedFolder> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This goes after the call to LetsPlot.setup_html(), | |
# but before calling ggplot(). | |
def setup_colab2pdf(): | |
def _repr_svg_(self): | |
from io import BytesIO | |
from sys import stdout | |
file_like = BytesIO() | |
self.to_svg(file_like) | |
return file_like.getvalue().decode(stdout.encoding) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<startup> | |
<supportedRuntime version="v4.0" /> | |
</startup> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @jest-environment jsdom | |
*/ | |
import { act, render, fireEvent } from "@testing-library/react"; | |
import PageComponentWeather from "../../../pages/components/weather"; | |
describe("PageComponentWeather", () => { | |
test("renders correctly", async () => { | |
let component: any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type {NextApiRequest, NextApiResponse, NextApiHandler} from "next"; | |
import {findByZip} from "./../../../../mongoose/weather/services"; | |
import dbConnect from "./../../../../middleware/db-connect"; | |
async function handler( | |
req: NextApiRequest, | |
res: NextApiResponse | |
): Promise<NextApiResponse<WeatherDetailType> | void> { | |
let data = await findByZip(req.query.zipcode as string); | |
return res.status(200).json(data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const query = ` | |
query { | |
artists(where: {name: "Red Hot Chili Peppers"}) { | |
albums { | |
title | |
} | |
} | |
} | |
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore } from 'redux'; | |
const initialCartState = []; | |
const CartTypes = { | |
ADD: 'ADD', | |
EMPTY: 'EMPTY', | |
REMOVE: 'REMOVE', | |
}; |
NewerOlder