Skip to content

Instantly share code, notes, and snippets.

@foofoodog
foofoodog / Ryobi adaptor.scad
Last active March 8, 2022 18:41
Big Clive Ryobi Adaptor
// Fron Big Clive
// https://www.youtube.com/watch?v=0oBbF3bcDck
//Ryobi adaptor
$fn=50;
height=20;
difference(){
union(){
//main block
cylinder(h=height,d=29);
translate([-14.5,0,0])
@foofoodog
foofoodog / Dockerfile
Last active July 6, 2019 19:28
steamcmd rust server
from ubuntu as patched
run apt-get update; \
apt-get install software-properties-common apt-utils debconf-utils -y; \
apt-get install --reinstall ca-certificates; \
add-apt-repository multiverse; \
dpkg --add-architecture i386; \
apt-get update;
from patched as steamcmd
copy rust.sh .
async Task Main()
{
Action<WorkItem> actionItem = (WorkItem w) => w.DoWork();
var jobs = (from x in Enumerable.Range(1, 64)
let workItem = new WorkItem() { Id = x }
select new ActionItem<WorkItem>()
{
item = workItem,
action = (t) => actionItem(t)
}).ToList();
# REF https://www.talkingdotnet.com/how-to-create-an-angular-6-app-with-visual-studio-2017/
# REF https://docs.docker.com/engine/examples/dotnetcore/#build-and-run-the-docker-image
FROM microsoft/dotnet:sdk AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN apt-get update; \
apt-get install -y gnupg gnupg2 gnupg1; \
@foofoodog
foofoodog / -node-red with dashboard and mosquitto in alpine docker.md
Last active April 7, 2018 13:22
node-red with dashboard and mosquitto in alpine docker

node-red with dashboard and mosquitto in alpine docker

Cmd wrapper around docker commands to build and run an IoT dashboard kind of thing. Tries to do the right thing:

  • Create the image if it does not exist then run the container.
  • Run the container if it does not exist and the image does.
  • Start the container if it exists and is stopped.
Usage: node-red-local [clean]
    clean: Remove container and image to start from scratch. Note that all flows and dashboard items will be lost.
@foofoodog
foofoodog / dl.cmd
Created March 28, 2018 22:31
youtube-dl as a linux docker on windows
@echo off
if %1.==. goto err
docker build -q -t utube . > nul
docker run --rm -v"%cd%":/data -e url="%*" utube
goto :eof
:err
echo needs 1 url arg
@foofoodog
foofoodog / index.htm
Last active May 7, 2016 17:54
OctoPrint monitoring starter
<html>
<head>
<script>
var printers = [
{name: "folger", key: "raspberry"},
{name: "simple", key: "raspberry"},
{name: "solid", key: "raspberry"},
{name: "printrbot", key: "raspberry"}
];
</script>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@foofoodog
foofoodog / App.js
Last active November 15, 2015 23:09
octoprint client libs
var App = function(ready) {
var self = this;
self.config = {
options : {baseurl: "http://localhost:5000", apikey:"raspberry"},
scripts: ["/static/webassets/packed_libs.js", "/static/webassets/packed_client.js"]
};
self.load = function(idx) {
idx = idx || 0;
if (idx === self.config.scripts.length) return self.done();
var tag = document.createElement("script");
@foofoodog
foofoodog / folger toc.linq
Last active September 20, 2015 15:04
LINQPad to parse specific github README.md and generate reddit markdown TOC
var readme = "https://github.com/cyberkni/FolgertechManuals/blob/master/2020i3/README.md";
var includes = new[] { "id=\"user-content-", "href=\"#" };
var excludes = new[] { "<article" };
// input
IEnumerable<XElement> elements;
using (var client = new WebClient())
{
elements = from line in client.DownloadString(readme).Split('\n')
where
includes.All(include => line.Contains(include))