Skip to content

Instantly share code, notes, and snippets.

View lostinplace's full-sized avatar

Chris Wheeler lostinplace

View GitHub Profile
@lostinplace
lostinplace / demo.json
Created May 27, 2023 19:13
AssistantFlow Graph Example
{
"vertices": {
"1": {
"type": "User Entered Text",
"content": "You are a helpful assistant",
"role": "system",
"name": ""
},
"2": {
"type": "User Entered Text",
import base64
import json
import shelve
import datetime
from typing import Dict
import boto3
from botocore.exceptions import BotoCoreError, ClientError
@lostinplace
lostinplace / machine.js
Created September 15, 2020 19:38
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'SWAPI',
initial: 'idle',
context: {
user: null
},
states: {
idle: {
on: {
FETCH: 'loading'
{ Blocks.ATM , new HashSet<Blocks>() {Blocks.ATM} },
{ Blocks.AlienBlocks , new HashSet<Blocks>() {Blocks.AlienBlocks} },
{ Blocks.AlienDeviceBlocks , new HashSet<Blocks>() {Blocks.AlienDeviceBlocks} },
{ Blocks.AlienLargeBlocks , new HashSet<Blocks>() {Blocks.AlienFull, Blocks.AlienThin, Blocks.AlienLargeBlocks, Blocks.AlienFullLarge, Blocks.AlienThinLarge} },
{ Blocks.AlienNPCBlocks , new HashSet<Blocks>() {Blocks.NPCAlienTemplate, Blocks.ScifiTableNPC2, Blocks.ScifiTableNPC3, Blocks.ScifiLargeSofaNPC, Blocks.ConsoleSmallNPC, Blocks.ScifiTableV2NPC, Blocks.SofaNPC, Blocks.StandingNPC, Blocks.ControlStationNPC, Blocks.ReceptionTableNPC, Blocks.ScifiSofaNPC, Blocks.ScifiTableNPC, Blocks.StandingNPC2, Blocks.AlienNPCBlocks, Blocks.CommandingOfficerAlien, Blocks.SecurityGuardAlien} },
{ Blocks.AncientStatue , new HashSet<Blocks>() {Blocks.AncientStatue} },
{ Blocks.AntennaBlocks , new HashSet<Blocks>() {Blocks.Antenna, Blocks.AntennaBlocks, Blocks.Antenna01, Blocks.Antenna02, Blocks.Antenna03, Blocks.Antenna04,
package wikiparser
import org.scalatest.{FlatSpec, Matchers}
import fastparse.all._
import fastparse.core.Parsed.{Failure, Success}
import scala.util.matching.Regex
import RegexParser._
package wikiparser
import fastparse.all._
import fastparse.core.{Mutable}
import scala.util.matching.Regex
class RegexParser(pattern: Regex, leapDistance:Int = 10, maxLength:Int=100) extends Parser[Regex.Match] {
import fastparse.core.{ParseCtx}
private val _startsWith = """^\^.*""".r
package wikiparser
import scala.language.implicitConversions
object Xml {
import fastparse.all._
val digits = "0123456789"
val Digit = P( CharIn(digits) )
import datetime
import math
import re
import dateutil.parser
class BitVectorTools:
bitvector_resolution_minutes = 15
def count_set_bits(a_bv):
tmp = a_bv
next_i = 0
last_diff = 0
tmp_diff = 0
set_bits_count = 0
most_contiguous_set_bits = 0
current_contiguous_set_bits = 0
@lostinplace
lostinplace / _.md
Created January 20, 2014 19:09
An inlet to Tributary