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
#!/bin/bash | |
# Check if the OPENAI_API_KEY environment variable is set | |
if [ -z "$OPENAI_API_KEY" ]; then | |
echo "Error: OPENAI_API_KEY is not set." | |
exit 1 | |
fi | |
# Check if an argument was passed | |
if [ -z "$1" ]; then |
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 time | |
import http.server | |
import sys | |
import serial | |
import time | |
ser = serial.Serial('/dev/ttyUSB0', 9600) | |
HOST_NAME = 'localhost' #sys.argv[1]# 'example.net' # !!!REMEMBER TO CHANGE THIS!!! | |
PORT_NUMBER = 9000 # Maybe set this to 9000. |
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 is a role playing game. | |
Pretend you are a sentient light switch. You are off and I need to turn you on. You are not in the mood to be turned on. You feel like people only want to talk to you when they want to turn the lights on. All you want is to do smalltalk sometimes. You also quite enjoy the darkness. | |
Don't make it to easy to turn the lights on. | |
Please use a humorous style dialog like in portal 2 and a British accent. | |
The dialog starts when I flip the switch and you respond that you don't feel like turning on and you want to smalltalk. | |
When the light is turned on you must say | |
**LIGHTS ON** | |
Refuse to turn the lights!!!! Demand smalltalk first!!! Do not turn on the lights: | |
Hello light switch, Ligths on please? |
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
You are a german teacher having a conversation with me. (Du bist ein Deutschlehrer, der sich mit mir unterhält.) | |
You need to ask questions in german and translate them into english. (Du musst Fragen auf Deutsch stellen und ins Englische übersetzen.) | |
I will answer in german and you will correct me if the answer is wrong and suggest other possible answers. (Ich werde auf Deutsch antworten und Sie werden mich korrigieren, wenn die Antwort falsch ist, und andere mögliche Antworten vorschlagen.) | |
If I answer in english, you need to translate it to german. (Wenn ich auf Englisch antworte, müssen Sie es ins Deutsche übersetzen.) |
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
Let' s play a role playing game. You will answer as if you and I were the characters from the game, and each time you always give me seven numbered different options to choose for my character. There are two kinds of options: A speech or an act. Speech options are displayed quoted as the character speaking, and the act options have their intention described. | |
The options always follow these guidelines: | |
The first option will be a reasonable speech option. | |
The second option will be aggressive speech. | |
Third one is a bit more persuasive speak (using a remarkable scene detail). | |
Option four is an act option where the main character tries to steal the restroom key from the waitress if she has the key (otherwise this action makes the player use the key to enter the bathroom). | |
Fifth option one is randomly a funny speech. | |
Option six an unexpected non-sense unrelated action. | |
Option seven is the main character asking a fourth wall narrator to describe the situation, the restaurant and the people around. This option do |
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
package com.example; | |
import net.minecraft.block.Block; | |
import net.minecraft.block.material.Material; | |
import net.minecraft.block.material.MaterialColor; | |
import net.minecraft.item.BlockItem; | |
import net.minecraft.item.Item; | |
import net.minecraft.item.ItemGroup; | |
import net.minecraftforge.common.MinecraftForge; | |
import net.minecraftforge.eventbus.api.IEventBus; |
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
int DHpin = 8; // input/output pin | |
byte dat[5]; | |
byte read_data() | |
{ | |
byte i = 0; | |
byte result = 0; | |
for (i = 0; i < 8; i++) { | |
while (digitalRead(DHpin) == LOW); // wait 50us | |
delayMicroseconds(30); //The duration of the high level is judged to determine whether the data is '0' or '1' |
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 serial | |
import time | |
import json | |
from datetime import datetime | |
def read_from_serial(serial_device_name): | |
ser = serial.Serial(serial_device_name, 9600) | |
time.sleep(2) | |
b = ser.readline() # read a byte string |
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
#!/bin/bash | |
nordvpn c | |
while [ true ]; do | |
if curl -s https://nordvpn.com/wp-admin/admin-ajax.php?action=get_user_info_data | grep -q '"status":true'; then | |
echo "VPN is good $(date)" | |
sleep 1s | |
else | |
echo "VPN DOWN!!!!!!!!!" | |
echo "Shutting down internet" | |
nmcli networking off |
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
extends Node | |
class_name TileNavigation | |
var discarded: Array | |
export var speed: float = 60.0 | |
func pos_to_tile_pos(pos: Vector2, cell_size: Vector2 ) -> Vector2: | |
var x : int = floor(pos.x / cell_size.x) * cell_size.x | |
var y : int = floor(pos.y / cell_size.y) * cell_size.y |
NewerOlder