Skip to content

Instantly share code, notes, and snippets.

@andrewpmiller
andrewpmiller / untitled.md
Last active March 6, 2016 12:58
Google analytics include

Google analytics include

<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-0000000-00']);
  _gaq.push(['_trackPageview']);
  (function() {
 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
@andrewpmiller
andrewpmiller / untitled.md
Created January 6, 2016 20:33
edit crontab with nano

Edit your crontab with nano

Because vim ruins my day every time...

export VISUAL=nano; crontab -e

@andrewpmiller
andrewpmiller / untitled.md
Created January 5, 2016 20:45
Homebrew Permissions Fix

Homebrew Permissions Fix

Everyone hates antivirus software – except IT departments.

Sophos does a particularly annoying thing on my work MacBook... some process (I think it's called "Sweep") constantly changes the permissions on /usr/local/bin so that I can't update or install Homebrew packages.

This unlocks things temporarily:

sudo chown -R $(whoami) /usr/local/bin

@andrewpmiller
andrewpmiller / leibniz.c
Created December 12, 2015 23:57
Formatted comment text for calculating Pi using the Leibniz formula
/*
Calculating Pi with the Leibniz formula:
1 1 1 1 π
1 - ––– + ––– - ––– + ––– - ... = –––
3 5 7 9 4
@andrewpmiller
andrewpmiller / gym-readme.md
Created December 9, 2015 21:37
Boilerplate readme for a Gymnasium course

Gymnasium Logo

{Course Name Goes Here}

Repository for the upcoming Gymnasium course.

@andrewpmiller
andrewpmiller / remove_libreoffice.md
Created November 29, 2015 18:02
Remove libreoffice from a Raspberry Pi
sudo apt-get remove --purge libreoffice*
sudo apt-get clean
sudo apt-get autoremove
@andrewpmiller
andrewpmiller / uno-ascii.ino
Last active November 22, 2015 14:31
Arduino Uno ascii map
/*
+-----+
+----[PWR]-------------------| USB |--+
| +-----+ |
| GND/RST2 [ ][ ] |
| MOSI2/SCK2 [ ][ ] A5/SCL[ ] | C5
| 5V/MISO2 [ ][ ] A4/SDA[ ] | C4
| AREF[ ] |
| GND[ ] |
| [ ]N/C SCK/13[ ] | B5
@andrewpmiller
andrewpmiller / getload.sh
Last active September 25, 2015 14:32
This miniscule script is a hack to return the current CPU load.
#!/bin/bash
# getload
#
# This miniscule script is a hack to return the current
# CPU load. It is simply stripping off the first
# value returned from loadavg.
cat /proc/loadavg | head -n1 | cut -d " " -f1
exit 0
#!/bin/bash
# cpustatus
#
# Prints the current state of the CPU like temperature, voltage and speed.
# Temperature is reported in degrees Fahrenheit (F) - converting from C requires bc
# CPU speed is calculated in megahertz (MHz).
function convert_to_MHz {
let value=$1/1000
echo "$value"
@andrewpmiller
andrewpmiller / remove_wolfram.md
Created February 21, 2015 15:39
Remove Wolfram from Raspberry Pi

sudo apt-get purge wolfram-engine