Skip to content

Instantly share code, notes, and snippets.

import React, { useCallback, useState } from "react";
const EnvironmentVariables = () => {
const [variables, setVariables] = useState([{ key: '', value: '' }]);
const handleInputChange = useCallback((index, field, value) => {
setVariables((prevVariables) => {
const newVariables = [...prevVariables];
newVariables[index][field] = value;
return newVariables;
@Briscoooe
Briscoooe / gpt.sh
Last active May 31, 2023 11:55
Bash command for asking ChatGPT stuff directly from the command line. Add this to your ~/.zshrc, ~/.bashrc, etc. and away you go
gpt() {
local input=$1
local model="gpt-3.5-turbo"
local temperature=0.5
local url="https://api.openai.com/v1/chat/completions"
local payload="{\"model\":\"$model\",\"messages\":[{\"role\":\"system\",\"content\":\"You are ChatGPT, a large language model trained by OpenAI.\\nKnowledge cutoff: 2021-09\\nCurrent date and time: $(date +%d/%m/%Y,%H:%M:%S)\"},{\"role\":\"user\",\"content\":\"$input\"}],\"temperature\":$temperature,\"stream\":false}"
local gpt=$(curl -s -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $OPEN_AI_KEY" -d "$payload" "$url")
echo "$gpt" | sed 's/$/\\n/' | tr -d '\n' | sed -e 's/“/"/g' -e 's/”/"/g' | sed '$ s/\\n$//' | jq -r '.choices[0].message.content' | glow -
}
namespace Geocoding
{
class HttpRequestSender
{
public HttpResponseObject SendHttpRequest(string url, Stopwatch watch)
{
IPEndPoint remoteIp = null;
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);
request.ServicePoint.BindIPEndPointDelegate = delegate(ServicePoint servicePoint, IPEndPoint remoteEndPoint, int retryCount)
{
@Briscoooe
Briscoooe / android screenshots
Created April 21, 2015 21:42
Android_Screenshots.zip
bdjdhdh