Skip to content

Instantly share code, notes, and snippets.

@yakticus
yakticus / gymserver.py
Last active October 5, 2022 09:36
Very basic REST API for OpenAI gym
#!flask/bin/python
import gym
from flask import Flask, Response, jsonify
import datetime
app = Flask(__name__)
envname = 'CartPole-v0'
env = gym.make(envname)
env.reset()
// include SPI, MP3 and SD libraries
#include <SPI.h>
#include <Adafruit_VS1053.h>
#include <SD.h>
// These are the pins used for the music maker shield
#define SHIELD_RESET -1 // VS1053 reset pin (unused!)
#define SHIELD_CS 7 // VS1053 chip select pin (output)
#define SHIELD_DCS 6 // VS1053 Data/command select pin (output)
@yakticus
yakticus / Example.scala
Last active November 23, 2017 10:04
Hlist filter attempt
import shapeless.HNil
object Example {
trait Fruit
case class Apple()
case class Pear()
// there could be more types of fruit defined elsewhere
class FruitBowl {
private[this] var fruits = HNil