Skip to content

Instantly share code, notes, and snippets.

@patmandenver
patmandenver / blink.sh
Created August 23, 2015 15:49
Blink LED slightly fancier code that removes error messages
@patmandenver
patmandenver / bashrc
Created August 23, 2015 16:29
Custom Prompt (add to end of .bashrc)
PS1="\[\033[1;30m\]\[\033[42m\][\u@\H]\[\033[30m\]\[\033[0m\]\w \n \[\033[1;32m\]❯\[\033[1;33m\]❯\[\033[1;31m\]❯ \[\033[1;37m\]"
@patmandenver
patmandenver / slack_functions
Created September 24, 2015 01:59
Helper function for using Slack WebHooks in Linux
#!/bin/bash
#
# Slack Helper Functions
#
#The MIT License (MIT)
#
#Copyright (c) 2015 "whiteboardcoder" Patrick Bailey
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
@patmandenver
patmandenver / adventure_time_song.ino
Created October 20, 2015 17:05
Arduino code to play adventure time theme music
/*
* Adventure time Song
* Using Tone()
*
* Connect Positive side of buzzer to pin 11
* Negative to Ground
*
* by: Patrick Bailey www.whiteboardcoder.com
* Last updated: 10/3/2015
*
/**
* This code is just a self help guide :)
*
* Author: Patrick Bailey
* Company: WhiteboardCoder
*/
/*
Intent Schema
{
@patmandenver
patmandenver / install_java_scala_sbt.sh
Last active April 15, 2021 16:30
Script to install Oracle Java 1.8, Scala 2.11.7 and sbt 0.13.9 on Ubuntu 14.04
#!/bin/bash
#
# Script to Install
# Oracle Java 1.8
# Scala 2.11.7
# sbt 0.13.9
#
##############################
#Script must be run as root/sudo
@patmandenver
patmandenver / webserver.py
Created February 17, 2016 13:19
Python SimpleHTTPServer with header outputs
#!/usr/bin/python
#
# Author: Patrick Bailey
# Twitter: @whiteboardoder
#
#The MIT License (MIT)
#
#Copyright (c) 2016 "whiteboardcoder" Patrick Bailey
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
@patmandenver
patmandenver / global.sbt
Created March 20, 2016 13:29
~/.sbt/0.13/global.sbt
/*
*
* sbt global sets shellPrompt
* Requires font that contains special Unicode Characters
*
* U+276f
* (powerline compatibile)
* U+E0A0 (gt branch symbol)
* U+E0A2 (padlock symbol)
* U+E0B0 (Right Arrow)
@patmandenver
patmandenver / colors.sh
Created March 25, 2016 16:28
Linux Prompt Colors
#!/bin/bash
for color in {0..255}; do echo -e "$color:\\033[38;5;${color}mhello\\033[48;5;${color}mworld\\033[0m"; done
@patmandenver
patmandenver / global.sbt
Last active March 25, 2016 21:05
sbt global shell prompt
shellPrompt := { state =>
def textColor(color: Int) = { s"\033[38;5;${color}m" }
def backgroundColor(color:Int) = { s"\033[48;5;${color}m" }
def reset = { s"\033[0m" }
def formatText(str: String)(txtColor: Int, backColor: Int) = {
s"${textColor(txtColor)}${backgroundColor(backColor)}${str}${reset}"
}
val red = 1
val green = 2