Skip to content

Instantly share code, notes, and snippets.

@foofoodog
foofoodog / UnitTest1.cs
Created May 26, 2012 02:36
Super simple sharepoint list item ORM.
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.SharePoint;
namespace TestProject2
{
[TestClass]
public class UnitTest1
@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 / Octo.cs
Last active January 22, 2022 09:25
Read only C# wrapper for OctoPrint API
/*
// OctoPrint API wrapper
// csc /target:library Octo.cs /r:System.Net.Http.dll
// linqpad
var server = "http://localhost:5000";
// print3r.Reader<print3r.Logs.Result>.Read(server).Dump();
// print3r.Reader<print3r.Connection.Result>.Read(server).Dump();
// print3r.Reader<print3r.Files.Result>.Read(server).Dump();
// print3r.Reader<print3r.Job.Result>.Read(server).Dump();
// print3r.Reader<print3r.Printer.Result>.Read(server).Dump();
C G Am F
No woman no cry
C F C G
No woman no cry
C G Am F
No woman no cry 1st verse
Here little darlin dont shed no tears 2nd verse
C F C
No woman no cry
@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 / powershell-winform.ps1
Created July 8, 2012 13:52
powershell-winform
New-Module -ScriptBlock {
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
$form = New-Object System.Windows.Forms.Form
$grid = New-Object System.Windows.Forms.PropertyGrid
$grid.Dock = [System.Windows.Forms.DockStyle]::Fill
$button = New-Object System.Windows.Forms.Button
$button.Text = "OK"
$button.Dock = [System.Windows.Forms.DockStyle]::Bottom