Skip to content

Instantly share code, notes, and snippets.

@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 / Library
Last active December 16, 2015 21:09
Library of some stuff
Library of some stuff
@foofoodog
foofoodog / fiddle.css
Last active December 16, 2015 21:00
jsfiddle test
body, button {
/* brilliant UX */
font-family :"Comic Sans MS"
}
@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 / PasswordReset.cshtml.patch
Created November 30, 2012 17:44
Patch for ASP.NET Web Site (Razor v2) Visual C# - Account\PasswordReset.cshtml - broken and erroneous validation.
--- OLD_PasswordReset.cshtml
+++ NEW_PasswordReset.cshtml
@@ -14,13 +14,13 @@
bool isSuccess = false;
// Setup validation
Validation.RequireField("newPassword", "The new password field is required.");
Validation.Add("confirmPassword",
Validator.EqualsTo("newPassword", "The new password and confirmation password do not match."));
- Validation.RequireField("passwordResetToken", "The password reset token field is required.");
GraphicsWindow.Title = "http://www.gotostcroix.com/live/harborcam.php"
url = "http://images.earthcam.com/affiliates/mmstcroix.jpg"
GraphicsWindow.Width = 640
GraphicsWindow.Height = 480
delay = 5000
oldImg = Shapes.AddImage(ImageList.LoadImage(url))
counter = 1 ' have to change url or silverlight caches the image
While "True"
newImg = Shapes.AddImage(ImageList.LoadImage(url + "?nc=" + counter))
Shapes.Move(newImg, 0, GraphicsWindow.Height + ImageList.GetHeightOfImage(newImg))
@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))
@foofoodog
foofoodog / nuke.cmd
Last active August 29, 2015 14:26
Rip and replace OctoPrint
#!/usr/bin/env bash
cd ~
sudo service octoprint stop
sudo rm -Rf OctoPrint
sudo rm -Rf .octoprint
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install python-pip python-dev python-setuptools python-virtualenv git libyaml-dev
git clone https://github.com/foosel/OctoPrint.git
cd OctoPrint
@foofoodog
foofoodog / Octoprint on windows
Last active August 29, 2015 14:22
Octoprint on windows
Requires Python 2.7 assumed to be at C:\Python27.
Assumes global Python install has pip and virtualenv and maybe other stuff.
Either git clone or unzip the repo files somewhere.
Assuming you are bleeding edge and want to try the dev branch https://github.com/foosel/OctoPrint/archive/devel.zip.
Assuming here that you unzipped it to c:\Temp and now have this directory C:\Temp\OctoPrint-devel\OctoPrint-devel.
Hint: Text after the colon in the commands below can be pasted into the cmd window.
Hint: To paste to the cmd window press [alt]+[space],e,p in the cmd window.