Skip to content

Instantly share code, notes, and snippets.

@mwiemarc
mwiemarc / ChatGPT Canvas HTML Renderer from Clipboard.url
Created October 7, 2024 05:10 — forked from rmtbb/ChatGPT Canvas HTML Renderer from Clipboard.url
Chrome Bookmarklet the lets you render a full HTML page with any included css and javascript that is currently copied to your clipboard. Also works for SVG code. Useful with ChatGPT Canvas
javascript:(function(){try{navigator.clipboard.readText().then(function(clipboardText){if(clipboardText){var newWindow=window.open("","_blank","width=800,height=600");newWindow.document.open();newWindow.document.write(clipboardText);newWindow.document.close();}else{alert('Clipboard is empty. Please copy some text to the clipboard first.');}}).catch(function(err){console.error('Failed to read clipboard contents: ',err);alert('An error occurred while trying to access the clipboard. Please ensure your browser allows clipboard access.');});}catch(e){console.error('An error occurred:',e);alert('An error occurred while trying to open the new window with the clipboard content.');}})();
@mwiemarc
mwiemarc / recorderWorkletProcessor.js
Created October 4, 2024 04:11 — forked from flpvsk/recorderWorkletProcessor.js
An example of a recorder based on AudioWorklet API.
/*
A worklet for recording in sync with AudioContext.currentTime.
More info about the API:
https://developers.google.com/web/updates/2017/12/audio-worklet
How to use:
1. Serve this file from your server (e.g. put it in the "public" folder) as is.
@mwiemarc
mwiemarc / haptic_lever.ino
Created September 2, 2024 01:18 — forked from jschoch/haptic_lever.ino
haptic detent with simpleFOC
// Open loop motor control example for L298N board
#include <SimpleFOC.h>
#include <neotimer.h>
#define IN1 14
#define IN2 12
#define IN3 13
//#define IN4 8
// BLDC motor & driver instance
@mwiemarc
mwiemarc / index.html
Created April 25, 2024 21:20 — forked from iashris/index.html
This is the template of html file to use for p5js projects for me
<!DOCTYPE html>
<html>
<head>
<title>p5js fullscreen template</title>
</head>
<style type="text/css">
canvas {
position: fixed;
top: 0; left: 0;
z-index: 1;
@mwiemarc
mwiemarc / .dockerignore
Created July 8, 2023 18:25 — forked from ksmithut/.dockerignore
Node Docker Compose nodemon
node_modules
@mwiemarc
mwiemarc / XMLRecieptInterpreter.cs
Created October 16, 2021 20:27
Custom XML Markup Interpreter to ESCPOS_NET commands
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Xml.Linq;
@mwiemarc
mwiemarc / HttpServer.cs
Created October 2, 2021 01:04 — forked from define-private-public/HttpServer.cs
A Simple HTTP server in C#
// Filename: HttpServer.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Threading.Tasks;
@mwiemarc
mwiemarc / SimpleHTTPServer.cs
Created October 2, 2021 01:00 — forked from aksakalli/SimpleHTTPServer.cs
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
//**************************************************************//
// Name : shiftOutCode, Hello World
// Author : Carlyn Maw,Tom Igoe, David A. Mellis
// Date : 25 Oct, 2006
// Modified: 26 Sep 2013
// Version : 2.0
// Notes : Code for using a 74HC595 Shift Register //
// : to show POV persistence of vision
// http://arduino.cc/en/Tutorial/ShiftOut
// using this sample code http://paulsarduino.co.uk/?page_id=50
/*********************************************************************
This is an example for our Monochrome OLEDs based on SSD1306 drivers
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/category/63_98
This example is for a 128x64 size display using I2C to communicate
3 pins are required to interface (2 I2C and one reset)
Adafruit invests time and resources providing this open source code,