This file contains hidden or 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 StateM = (_ => { | |
| let self = {}; | |
| self.new = m => { | |
| m.bind = self.bind(m); | |
| return m; | |
| }; | |
| self.pure = x => self.new(s => [x, s]); | |
| self.bind = m => k => self.new(s => { | |
| let [x, ns] = m(s); | |
| return k(x)(ns); |
This file contains hidden or 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
| -- The Library | |
| accessor getter setter f x = (setter newVal x, getter x) where newVal = f (getter x) | |
| get accessor x = snd $ accessor id x | |
| set accessor f x = fst $ accessor f x | |
| composeAccessors ac1 ac2 modifier obj = | |
| (newObj, value) |
This file contains hidden or 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 | |
| import json | |
| import urllib.request | |
| import urllib.error | |
| import sys | |
| OPENAI_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxx" | |
| API_URL="https://example.com/v1/chat/completions" |
This file contains hidden or 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
| { | |
| "ObjectStates": [ | |
| { | |
| "Name": "Deck", | |
| "Transform": { | |
| "posX": 0, | |
| "posY": 1, | |
| "posZ": 0, | |
| "rotX": 0, | |
| "rotY": 180.0, |
This file contains hidden or 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
| call plug#begin() | |
| "Plug 'nvim-lua/plenary.nvim' | |
| "Plug 'github/copilot.vim' | |
| Plug 'neovim/nvim-lspconfig' | |
| Plug 'nvim-tree/nvim-tree.lua' | |
| Plug 'nvim-tree/nvim-web-devicons' | |
| Plug 'akinsho/bufferline.nvim' | |
| Plug 'leafOfTree/vim-svelte-plugin' |
This file contains hidden or 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
| def str_lambda(code, name = '_'): | |
| env = {} | |
| eval("exec(code, env)", {"code": 'def ' + name + code, "env": env}) | |
| return env[name] | |
| f = str_lambda("""(a, b): | |
| return a + b""") | |
| print(f(1, 2)) |
This file contains hidden or 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 | |
| import logging | |
| from telegram import ForceReply, Update, Message, Chat | |
| from telegram.ext import Application, CommandHandler, ContextTypes, MessageHandler, filters | |
| from collections import deque | |
| import subprocess | |
| import asyncio | |
| import random | |
| import json |
This file contains hidden or 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
| function showPanel(player, value, id) | |
| if (UI.getAttribute(value, "active") == "false") then | |
| UI.show(value) | |
| end | |
| end | |
| function hidePanel(player, value, id) | |
| UI.hide(value) | |
| end |
This file contains hidden or 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 | |
| lang=eng | |
| rm /tmp/scrtrans* | |
| shotgun -g $(slop) /tmp/scrtrans.png | |
| tesseract -l $lang /tmp/scrtrans.png /tmp/scrtrans | |
| cat /tmp/scrtrans.txt | tr '\n' ' ' > /tmp/scrtrans.txt.2 | |
| mv /tmp/scrtrans.txt.2 /tmp/scrtrans.txt |
This file contains hidden or 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 | |
| import json | |
| import urllib.request | |
| import urllib.parse | |
| import sys | |
| input = sys.stdin.read() | |
| apikey = 'xxxxxxxxx' |