Skip to content

Instantly share code, notes, and snippets.

@hdary85
hdary85 / gui22
Created November 30, 2023 04:26
import tkinter as tk
from tkinter import simpledialog, messagebox
class NestedDictManager:
def __init__(self, root, data):
self.root = root
self.root.title("Nested Dictionary Manager")
self.data = data # Use the provided dictionary
self.tree = tk.ttk.Treeview(self.root)
import tkinter as tk
from tkinter import simpledialog, messagebox
class NestedDictManager:
def __init__(self, root):
self.root = root
self.root.title("Nested Dictionary Manager")
self.data = {
'key1': 'value1',
@rain-1
rain-1 / GPT-4 Reverse Turing Test.md
Last active April 16, 2024 23:19
GPT-4 Reverse Turing Test

The reverse turing test

I asked GPT-4 to come up with 10 questions to determine if the answerer was AI or human.

I provided my own answers for these questions and I also asked ChatGPT to answer them.

The result is that GPT-4 was able to correctly differentiate between AI and Human.

#!/usr/bin/env bash
set -e
# pj-append.bash is a timestamped log file for you, a human. Set up a cron job to launch it every
# hour to note what you were working on, or append lines from the terminal whenever you're chewing
# on a hard problem.
#
# Use the data to build a picture of what you worked on during the last week, or grep
# last quarter's log to find out why you decided to use library A instead of library B.
#
@utkarsharma2
utkarsharma2 / fabricate_dag.py
Created April 1, 2021 13:54
Dynamically Create Airflow DAG(s) via JSON.
"""Dag Factory"""
from datetime import datetime
from airflow import DAG
def create_dag(schedule, default_args, definition):
"""Create dags dynamically."""
with DAG(
definition["name"], schedule_interval=schedule, default_args=default_args
) as dag:
@joepie91
joepie91 / vpn.md
Last active May 20, 2024 03:37
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@karpathy
karpathy / min-char-rnn.py
Last active May 22, 2024 08:28
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)