Skip to content

Instantly share code, notes, and snippets.

View capndesign's full-sized avatar

Matt Jacobs capndesign

View GitHub Profile
@capndesign
capndesign / spelling-bee.js
Last active November 2, 2023 05:16
Spelling Bee Help
const letters = ["P", "H", "A", "D", "L", "E", "N"]
const middleLetter = "H"
const wordStart = "PE";
let possibleWords = [];
const updateWordList = (words, maxLength) => {
if (!words[0] || words[0].length < maxLength) {
const newWords = words.map(word => {
return letters.map((letter) => {
@capndesign
capndesign / README.md
Last active April 7, 2017 08:49
Connecting a Dash Button to IFTTT

Earlier in the week, I saw a Medium piece about using Dash buttons as a cheap connected device, and decided to play with it. I decided the most flexible solution was to wire it to IFTTT, so I did that.

He has instructions, but here’s what I did.

  1. Create a virtualenv and install Scapy.
  2. Then install Requests.
  3. Follow the instructions on Medium to get the MAC address of your device.
  4. Learn how to use the Maker channel and create a URL for this trigger.
  5. Modify your dash-button.py file to match the one below and fill in the right information.
  6. Create an IFTTT recipe and go to town.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="stylesh.css"/>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="script1.js"></script>
</head>
<body>
<div id="box">
@capndesign
capndesign / gist:8964004
Created February 12, 2014 20:36
Keybase Proof!
### Keybase proof
I hereby claim:
* I am capndesign on github.
* I am capndesign (https://keybase.io/capndesign) on keybase.
* I have the public key with fingerprint E060&nbsp;0318&nbsp;C622&nbsp;F735&nbsp;D82E&nbsp;&nbsp;DF3D&nbsp;5B09&nbsp;4948&nbsp;B111&nbsp;51F2
To claim this, I am signing the following object:
@capndesign
capndesign / footnotes.html
Created October 17, 2011 19:30
Hovering Footnotes
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
</head>
<body>
<p>I am a sentence that needs some additional information<sup><a href="#footnote-1-text" rel="footnote" id="footnote-1-link">1</a></sup></p>
<h4>Footnotes</h4>
@capndesign
capndesign / bookmarklet.js
Created November 16, 2010 22:55
My staging version of the Typekit Colophon bookmarklet
javascript:(function(){s=document.createElement('script');s.type='text/javascript';s.src='https://gist.github.com/raw/702689/typekit-colophon.js';document.getElementsByTagName('head').item(0).appendChild(s);void('')})();
@capndesign
capndesign / bookmarklet.js
Created November 16, 2010 04:12 — forked from markpasc/bookmarklet.js
Install this as a bookmarklet and it will show the site's colophon if it uses TypeKit.
javascript:(function(){s=document.createElement('script');s.type='text/javascript';s.src='https://gist.github.com/raw/701397/typekit-colophon.js';document.getElementsByTagName('head').item(0).appendChild(s);void('')})();
@capndesign
capndesign / typekit-colophon.js
Created November 12, 2010 17:41
(Old Version) Install this as a bookmarklet and it will show the site's colophon if it uses TypeKit.
javascript:a=document.getElementsByTagName('script');y=''; for (i=0;i < (a.length - 1);i++) { x=a[i].getAttribute('src'); if(x) { if (x.search('typekit') >= 1) { var y='http://typekit.com/colophons/' + x.substring(23,30); } } } if (y != '') { window.location.assign(y); } else { void(y); alert('This site doesn\'t use Typekit!'); }
@capndesign
capndesign / pagination.js
Created April 13, 2010 15:00
A method for adding new entries to the bottom of an index with AJAX in Movable Type. It requires jQuery.
$(document).ready(function() {
var page = 1;
$('.load-posts').click(function() {
$('.article:last').after('<div id="ajax-loader">Loading Data</div>');
page++;
var contentUrl = '/cgi-bin/mt/mt-search.cgi?page=' + page;
if ($(this).attr('id') == 'category-posts') { contentUrl += '&IncludeBlogs=1&limit=20&category=' + catId + '&archive_type=Category'; }
if ($(this).attr('id') == 'index-posts') { contentUrl += '&IncludeBlogs=1,4&limit=20&archive_type=Index'; }
$.get(contentUrl, function(data) {
if (data != '') {
@capndesign
capndesign / multipage-articles.html
Created January 4, 2010 20:24
Multi-page Articles with JQuery
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="">
<head>
<title>Multipage Article</title>
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquery.query-2.1.7.js"></script>
<script type="text/javascript">
$('.entry-permalink .entry-body').ready(function() {
var text = $('.entry-permalink .entry-body').html();