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
from typing import Any | |
from functools import partial | |
import logging as log | |
import os | |
import re | |
import subprocess | |
from autobot.funcs.base import Fn | |
from autobot.funcs.helpers import canonicalize_path |
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
from abc import ABC, abstractmethod | |
class Fn(ABC): | |
def __init__(self, | |
name, | |
description, | |
params, | |
required=None): | |
self.name = name | |
self.description = description |
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
Prompt | |
Please write me a classic Snake game in a single page HTML document with the CSS and JS inline. | |
ChatGPT | |
Here's a simple classic Snake game using HTML, CSS, and JavaScript, all within a single HTML file. Just copy and paste the code below into a new HTML file, then open it in your web browser to play the game. | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> |
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 python3 | |
# -*- coding: utf-8 -*- | |
# Builtins | |
import json | |
import os | |
import sys | |
import time | |
# Local |
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
ADD = lambda a: lambda b: \ | |
lambda f: lambda x: b(f)(a(f)(x)) | |
MULT = lambda a: lambda b: \ | |
lambda f: lambda x: a(b(f))(x) | |
ZERO = lambda f: lambda x: x | |
ONE = lambda f: lambda x: f(x) | |
TWO = ADD(ONE)(ONE) | |
THREE = ADD(ONE)(TWO) | |
FOUR = ADD(TWO)(TWO) |
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
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE MultiWayIf #-} | |
{-# LANGUAGE OverloadedLabels #-} | |
module Example where | |
import GHC.Generics ( Generic ) | |
import Control.Lens ( (+=) | |
, (*=) |
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
{-# LANGUAGE DeriveDataTypeable #-} | |
{-# LANGUAGE TypeApplications #-} | |
module Biplate where | |
import Control.Lens | |
import Data.Data | |
import Data.Data.Lens | |
data B = C | D | E |
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
{-# LANGUAGE DeriveDataTypeable #-} | |
{-# LANGUAGE TypeApplications #-} | |
module Biplate where | |
import Control.Lens | |
import Data.Data | |
import Data.Data.Lens | |
data B = C | D | E |
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
{-# LANGUAGE DeriveDataTypeable #-} | |
module Biplate where | |
import Control.Lens | |
import Data.Data | |
import Data.Data.Lens | |
newtype X a = X a | |
deriving (Data, Show) |
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
{-# LANGUAGE OverloadedStrings #-} | |
module GetIn where | |
import Prelude hiding ( lookup ) | |
import Control.Monad ( (<=<) | |
, join | |
) | |
import Data.Aeson ( Value( Array |
NewerOlder