Skip to content

Instantly share code, notes, and snippets.

View RandomArray's full-sized avatar

Mike Johanning RandomArray

View GitHub Profile
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar
@RandomArray
RandomArray / checktemp.sh
Last active January 7, 2022 06:38 — forked from uGeek/INSTALL.md
Log Raspberry Pi temperature to text file
#!/bin/bash
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
#RPi4 has a different path to vcgencmd on bullseye
gpuTemp=$(/opt/vc/bin/vcgencmd measure_temp 2>/dev/null || /usr/bin/vcgencmd measure_temp 2>/dev/null)
# Function to write the temperature into the log
function writeToLog() {

Web Design Contract

Based on Contract Killer, an open-source contract for web developers.

Summary:

I’ll always do my best to fulfill your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. I have no desire to trick you into signing something that you might later regret. What I do want is what’s best for both parties, now and in the future.

So in short;

You ([CLIENT COMPANY]), located at [CLIENT ADDRESS] are hiring me ([DEVELOPER]) located at [DEVELOPER ADDRESS] to design and develop a web site for the estimated total price of [QUOTE] as outlined in our previous correspondence.

@RandomArray
RandomArray / select-state-v1.php
Last active November 9, 2016 09:55 — forked from solepixel/select-state-v1.php
PHP States Select
<?php
$selected = ' selected="selected"';
?>
<select name="state" id="state" class="form-control">
<option value=""<?php if(!isset($contact['state']) || empty($contact['state']))echo $selected; ?> disabled>State</option>
<option value="AL"<?php if($contact['state'] == 'AL')echo $selected; ?>>Alabama</option>
<option value="AK"<?php if($contact['state'] == 'AK')echo $selected; ?>>Alaska</option>
@RandomArray
RandomArray / criticalcss.html
Created August 31, 2016 03:50 — forked from PaulKinlan/criticalcss.html
Detect Critical CSS
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<h2>Original CSS</h2>
<style style="display: block; white-space: pre; font-family: monospace">
h2 { margin:0; }
@RandomArray
RandomArray / install_iorpi.sh
Last active February 12, 2018 15:56
A BASH script for easy installation of io.js on a Raspberry Pi
#!/bin/bash
# ---------------------------------------------------------------------------------------
# install_iorpi.sh - A BASH shell script for Easy installation of io.js on a Rasberry Pi
# ---------------------------------------------------------------------------------------
PROGNAME=${0##*/}
VERSION="0.1.1"
clean_up() { # Perform pre-exit housekeeping
return