Skip to content

Instantly share code, notes, and snippets.

View tbeseda's full-sized avatar
🐀
womp rat

Taylor Beseda tbeseda

🐀
womp rat
View GitHub Profile
@tbeseda
tbeseda / README.md
Last active December 15, 2023 01:42
print 2 big strings side by side in the terminal

UPDATE: this was published as a module on npm

Usage

Like in a test...

import assert from 'node:assert/strict'
import test from 'node:test'
import sideBySide from './side-by-side.js'

🦉

hoot hoot

class HCardPresenter {
// raw properties
#data;
// class consumer interface as proxy
#interface = new Proxy(this, {
get(obj, key) {
return obj[key] || obj.mf[key];
},
});
// properties proxy for #data
@tbeseda
tbeseda / gitclean.sh
Last active August 11, 2022 02:13
My gitclean command. Prompts if you'd like to proceed with delete.
# uses gum: https://github.com/charmbracelet/gum
gitclean() {
DIRTY=$(git clean -Xdn | sed 's/Would remove //g')
gum style \
--foreground 196 --border thick --border-foreground 88 \
--margin "1 2" --padding "1 3" "$DIRTY"
gum confirm "🧹 Delete these?" \
&& git clean -Xdf \
@tbeseda
tbeseda / wobble.css
Created February 8, 2012 00:12
slowly wobble an element with CSS -- shamelessly ripped from love.travis-ci
/* just webkit, 'cause yeah... */
@-webkit-keyframes wobble {
0% { -webkit-transform: rotate(0deg); }
20% { -webkit-transform: rotate(2deg); }
50% { -webkit-transform: rotate(-2deg); }
100% { -webkit-transform: rotate(0deg); }
}
.wobble { -webkit-animation: wobble 5s infinite; }
@tbeseda
tbeseda / rbenv_usage.md
Created November 18, 2011 00:47
Basic rbenv usage

(specify your favorite flavor if you're not ready for 1.9.3):

$ rbenv install 1.9.3-p0

to rebuild rbenv's shims, when you install a new system system gem with a binary (like rake):

$ rbenv rehash

set a global version of Ruby to be used (instead of your system Ruby):

BEGIN MESSAGE.
WeFUkTWPAZhsjin wU2caGSa28CMuiV 8QSAozTzd6qds7Q IkI7hFsQUkddZVA
jCFMT2fiwBR9902 msckGKe2q17TCKq 6Xr2MZHgg4NizN6 ArXZTHJ1Jm91lsq
OT0FUZD6dBx2oCj AYMCxCKf7mgoV7v B8bJ3yYcDhuUvwo mKo7W5PR5KoscdY
gCB227ijRIdAlmX cOiaWiDyCmxtLST YM5b82IP.
END MESSAGE.

Visualize data from a SmartThings sensor with Dweet and Freeboard

My SmartThings multisensor is a great little piece of technology. It reports, in real time, motion, temperature, and open/close state of my back door. The iOS app is slick, too, but I wanted a way to view it from my computer and have access to historical data.
Enter Dweet and Freeboard from Buglabs.

The SmartThings SmartApp and Dweet

There's actually no setup required on Dweet (but be sure to check out their nifty demo). It just starts eating data and making it available for use via HTTP/JSON!

@tbeseda
tbeseda / Snoopy
Created September 13, 2010 18:30
javascript:(function()%7Bvar%20d%3Ddocument%2Cs%2Ce%3Bvar%20el%3Dd.getElementById('snpy')%3Bif(typeof%20Snoopy!%3D'undefined')%7BSnoopy.toggle()%3Breturn%7Delse%20if(el)%7Bel.className%3D%2Fclosed%2F.test(el.className)%3Fel.className.replace('closed'%2C'')%3Ael.className%2B'%20closed'%3Breturn%7Ds%3Dd.createElement('link')%3Bs.setAttribute('href'%2C'http%3A%2F%2Fsnoopy-assets.allmarkedup.com%2Fsnoopy-min.css')%3Bs.setAttribute('rel'%2C'stylesheet')%3Bs.setAttribute('type'%2C'text%2Fcss')%3Bd.getElementsByTagName('head')%5B0%5D.appendChild(s)%3Be%3Dd.createElement('script')%3Be.setAttribute('src'%2C'http%3A%2F%2Fsnoopy-assets.allmarkedup.com%2Fsnoopy-min.js')%3Bd.getElementsByTagName('body')%5B0%5D.appendChild(e)%7D)()%3B