Skip to content

Instantly share code, notes, and snippets.

View Michael-F-Ellis's full-sized avatar

Michael-F-Ellis

  • Ellis & Grant, Inc.
  • Weaverville, NC (USA)
View GitHub Profile
@Michael-F-Ellis
Michael-F-Ellis / test.html
Created September 11, 2016 17:57
pure.js:84 Uncaught pure error: cannot have more than one loop on a target
<!DOCTYPE html>
<html>
<head>
<title>PURE Test</title>
<script src="http://pure.github.io/pure/libs/pure.js"></script>
</head>
<body>
<!-- HTML template -->
<div data-role="page">
@Michael-F-Ellis
Michael-F-Ellis / riddler161021.py
Last active October 24, 2016 15:42
Brute force solver for Riddle Express problem described at http://fivethirtyeight.com/features/this-challenge-will-boggle-your-mind/
"""
Python (2.x) brute force solver for fivethirtyeight.com Riddler Express problem 10/21/2016.
May be applied to any ascii text file containing a list of words to be considered.
Tested with word2.txt file from https://github.com/dwyl/english-words.
Usage:
python riddler161021.py <textfile>
Author: Michael F. Ellis
@Michael-F-Ellis
Michael-F-Ellis / takenote.scpt
Created February 21, 2017 18:40
AppleScript for "spring-loaded" jump to a frequently used app.
#!/usr/bin/osascript
-- OS X script for "spring-loaded" app switching
-- Useful if you have a preferred app for jotting notes and ideas.
-- I use MacVim with Vimwiki, but you can use whatever by changing one line in this script.
-- To make this useful, you need to assign a hotkey.
-- OS X won't let you directly assign a hotkey to a script.
-- You can get around that by creating an Automator Service that runs this script.
-- See http://apple.stackexchange.com/questions/175215/how-do-i-assign-a-keyboard-shortcut-to-an-applescript-i-wrote for how to do that.
-- I use Ctrl-Cmd-B because its not commonly used by other apps. You may need something else.
@Michael-F-Ellis
Michael-F-Ellis / keypad.go
Created April 13, 2020 21:35
Simple numeric keypad using Fyne
package main
import (
"fmt"
"fyne.io/fyne"
"fyne.io/fyne/app"
"fyne.io/fyne/layout"
"fyne.io/fyne/theme"
"fyne.io/fyne/widget"
@Michael-F-Ellis
Michael-F-Ellis / main.go
Last active May 5, 2020 01:03
Minimal app to reproduce a mem leak when loading image files to Fyne. See https://github.com/fyne-io/fyne/issues/348
package main
import (
"flag"
"log"
"time"
"net/http"
_ "net/http/pprof"
@Michael-F-Ellis
Michael-F-Ellis / BlinkRGB.ino
Created September 25, 2021 00:55
Arduino code to blink multiple LED's at different rates. Solution to problem posed in Sept 24, 2021 workshop at The Generator in Burlington VT.
/*
BlinkRGB
Author: Mike Ellis
Example code showing how use the millis() function to blink
3 different LED's at different rates.
This code is in the public domain.
*/
@Michael-F-Ellis
Michael-F-Ellis / dmaregs.go
Created November 15, 2021 22:12
RP2040 register definitions translated from C #defines to Go constants
package picodma // abitrary package name to keep Go happy
/**
* TRANSLATED FROM pico-sdk hardware/regs/dma.h which is Copyright (c)
* 2021 Raspberry Pi (Trading) Ltd. SPDX-License-Identifier: BSD-3-Clause
*/
// =============================================================================
// Register block : DMA
// Version : 1
// Bus type : apb
@Michael-F-Ellis
Michael-F-Ellis / hello.py
Created December 2, 2021 17:48
Arete Workshop code examples
# The machine library contains functions you can use control the Pico hardware.
# In this example program, we're using the Pin class to configure and control
# the GPIO pins.
from machine import Pin
# The utime library contains functions that allow us to read the current time
# and to delay (aka 'sleep') for seconds, milliseconds, or microseconds.
import utime
# main runs until stopped, blinking the Pico built-in LED at 1 second intervals.
@Michael-F-Ellis
Michael-F-Ellis / app.py
Created March 28, 2024 21:50
Stable Cascade App code discussed in a question submitted to StackOverflow
import gradio as gr
import spaces
from diffusers import StableCascadeCombinedPipeline
import os
import torch
from PIL import Image
import random
# Constants
repo = "stabilityai/stable-cascade"