Skip to content

Instantly share code, notes, and snippets.

@mshuffett
mshuffett / clock.html
Created April 16, 2024 20:04
Plain Clock
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Clock</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
@mshuffett
mshuffett / wifi.py
Last active August 14, 2023 23:41
Wifi Signal Strength
import subprocess
import matplotlib.pyplot as plt
import threading
# Use a nicer style for the plot
plt.style.use('seaborn-darkgrid')
def get_wifi_data():
@mshuffett
mshuffett / gmail-compose-encoder.js
Created November 15, 2021 19:04 — forked from danrouse/gmail-compose-encoder.js
gmail `compose` query parameter encoder/decoder
const fullAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const restrictedAlphabet = 'BCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz';
const threadPrefix = 'thread-';
const messagePrefix = 'msg-';
const isWhitespace = str => /^[\s\xa0]*$/.test(str);
const isInvalidString = str => str ? (str.indexOf(threadPrefix) !== -1 || str.indexOf(messagePrefix) !== -1) : false;
const encode = function(str) {
if (isWhitespace(str)) return str;
@mshuffett
mshuffett / dash-hover-rows.js
Last active January 18, 2018 09:12
JQuery Shim to support row hovering in Dash
$(window).ready(function() {
$(document).arrive('.hover-row', function() {
$('.data-table > tbody > tr').hover(function() {
var rowNum = $(this).children('.row-num').text();
$(this).closest('.table-div').children('.hover-row').val(rowNum);
});
});
});
@mshuffett
mshuffett / install-tmux.sh
Created September 8, 2017 16:14
Install tmux without root
#!/usr/bin/env bash
cd /tmp
# libevent
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar xvf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=$HOME
make -j 8
; how to write scripts: http://www.autohotkey.com/docs/
#IfWinActive ahk_class CabinetWClass ; File Explorer
^Backspace::
#IfWinActive ahk_class Progman ; Desktop
^Backspace::
#IfWinActive ahk_class Notepad
^Backspace::
Send ^+{Left}{Backspace}
#IfWinActive
@mshuffett
mshuffett / solarized_dark.vimp
Created December 13, 2014 21:49
Modified solarized dark theme for vimperator
" ==VimperatorColorSchema==
" name: Solarlized enhanced by Kenta Suzuki. (Based on 'Solarized')
" url: https://github.com/suzuken/dotfiles/blob/master/vimperator/colors/solarized.vimp
" ==/VimperatorColorSchema==
"
" Solarized - Ethan Schoonover
" http://ethanschoonover.com/solarized
"
" SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB
" --------- ------- ---- ------- ----------- ---------- ----------- -----------
@mshuffett
mshuffett / README.md
Last active August 29, 2015 14:05 — forked from agnoster/README.md
Fork of Agnoster

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@mshuffett
mshuffett / Wikipedia.ipynb
Created May 23, 2014 23:21
IPython Notebook Using Wikipedia API
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mshuffett
mshuffett / email.py
Created March 30, 2014 14:54
Send email using Gmail
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
def sendmail(message, subject='subject', username='username', password='password', address='reciever'):
msg = MIMEMultipart()
msg['From'] = username
msg['To'] = address
msg['Subject'] = subject
msg.attach(MIMEText(message, 'plain'))