Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthony DiGirolamo AnthonyDiGirolamo

View GitHub Profile
View mcp23017_keyboard.ino
#include <Wire.h>
#include "Adafruit_MCP23017.h"
Adafruit_MCP23017 mcp;
#define NUM_ROWS 5
#define NUM_COLS 10
uint32_t hold_time[NUM_ROWS][NUM_COLS];
View .Xresources
! Font options - ~/.fonts.conf seems to override this
! Resolution for Xft in dots per inch (e.g. 96)
!Xft.dpi: 128
! Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr)
!Xft.rgba: rgba
!Xft.antialias: 1
!Xft.hinting: 1
!Xft.autohint: 0
! What degree of hinting to use (hintnone, hintslight, hintmedium, or hintfull)
!Xft.hintstyle: hintslight
View vimfx-hints.css
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url-prefix(http://), url-prefix(https://), url-prefix(ftp://), url-prefix(file://) {
/* AGENT_SHEET */
.VimFxHintMarker { position: absolute !important; display: block !important; top: -1px; left: -1px; white-space: nowrap !important; overflow: hidden !important; font-size: 11px !important; padding: 2px 3px !important; background-color: #feda31 !important; border: 0 !important; border-radius: 2px !important; box-shadow: inset 0 -2px 0 #b39922 !important;
}
.VimFxHintMarker span { color: #4a400e !important; font-family: Helvetica, Arial, sans-serif !important; font-weight: bold !important; font-size: 16px !important;
}
.VimFxHintMarker > .VimFxCharMatch { color: #dcbc2a !important; }
@AnthonyDiGirolamo
AnthonyDiGirolamo / kanboard.user.js
Last active Aug 29, 2015
kanboard greasemonkey tweaks
View kanboard.user.js
// ==UserScript==
// @name kanboard
// @namespace https://kanboard.ccs.ornl.gov/
// @include https://kanboard.ccs.ornl.gov/*
// @version 1
// @grant none
// ==/UserScript==
function addGlobalStyle(css) {
var head, style;
@AnthonyDiGirolamo
AnthonyDiGirolamo / py_read_file.py
Last active Dec 16, 2019
How to read a file in python line by line. This method incrementally loads the file.
View py_read_file.py
#!/usr/bin/env python
#import pprint
#pp = pprint.PrettyPrinter(indent=4, width=110).pprint
with open('all_messages.log') as f:
for i, line in enumerate(f):
print("{0}:".format(i), end='')
print(line)
@AnthonyDiGirolamo
AnthonyDiGirolamo / rgb_cpu_usage.c
Last active May 4, 2020
RGB LED CPU usage on a Raspberry Pi
View rgb_cpu_usage.c
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <linux/spi/spidev.h>
#include <signal.h>
@AnthonyDiGirolamo
AnthonyDiGirolamo / pi_setup.sh
Last active Sep 12, 2020
Raspberry Pi Provisioning Script
View pi_setup.sh
#!/usr/bin/env bash
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp -r archives pi@192.168.3.249:~/ ; ~/apps/sshpass/bin/sshpass -p 'raspberry' ssh pi@192.168.3.249 'sudo mv ~/archives/* /var/cache/apt/archives/'
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp pi_setup pi@192.168.3.249:~/ ; ~/apps/sshpass/bin/sshpass -p 'raspberry' ssh pi@192.168.3.249 'bash ~/pi_setup pi9 109'
# for pi in 110 111 112
# do
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp pi_keys pi@192.168.3.$pi:~/.ssh/authorized_keys
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp pi_hosts pi_mpihostsfile pi@192.168.3.$pi:~/
# ~/apps/sshpass/bin/sshpass -p 'raspberry' scp ~/.ssh/config pi@192.168.3.$pi:~/.ssh/
# ~/apps/sshpass/bin/sshpass -p 'raspberry' ssh pi@192.168.3.$pi 'cat /etc/hosts pi_hosts | tee hosts ; sudo cp hosts /etc/hosts'
View count_bits_set.c
#include <stdio.h>
#define BYTETOBINARYPATTERN "%d%d%d%d%d%d%d%d"
#define BYTETOBINARY(byte) \
(byte & 0x80 ? 1 : 0), \
(byte & 0x40 ? 1 : 0), \
(byte & 0x20 ? 1 : 0), \
(byte & 0x10 ? 1 : 0), \
(byte & 0x08 ? 1 : 0), \
(byte & 0x04 ? 1 : 0), \
@AnthonyDiGirolamo
AnthonyDiGirolamo / userChrome.css
Created Jul 22, 2013
postbox userChrome cusomizations
View userChrome.css
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Set Font Size In Folder Pane */
#folderTree >treechildren::-moz-tree-cell-text {
/*font-family: Lucida Sans !important;*/
font-size: 12pt !important; }
#folderTree treechildren::-moz-tree-row {
height: 32px !important; }
@AnthonyDiGirolamo
AnthonyDiGirolamo / userChrome.css
Last active May 26, 2020
thunderbird custom style for message and folder pane list
View userChrome.css
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* Set Font Size In Folder Pane */
#folderTree >treechildren::-moz-tree-cell-text {
/*font-family: Lucida Sans !important;*/
font-size: 12pt !important; }
/* Set Font Size In Thread Pane */
You can’t perform that action at this time.