Skip to content

Instantly share code, notes, and snippets.

View Crysknife007's full-sized avatar

Spike Snell Crysknife007

View GitHub Profile
@Crysknife007
Crysknife007 / moonphase.sh
Last active March 23, 2024 02:44 — forked from zuloo/moonphase.sh
moonphase bash script
#!/bin/bash
# Calculate approximate moon phase
moonphase(){
local lp=2551443
local now=$(date -u +"%s")
local newmoon=592500
local phase=$((($now - $newmoon) % $lp))
local phase_number=$((((phase / 86400) + 1)*100000))
@Crysknife007
Crysknife007 / displayCounter.ino
Created February 1, 2024 23:58
A simple counter for a tm1637 display.
// .---------------------------------------------------------.
// | Spike Snell - 2024 |
// | A simple counter for a tm1637 display. |
// | |
// | - The count is reset after a long press of the button. |
// `---------------------------------------------------------'
// Import the tm1637Display library from - https://github.com/avishorp/TM1637
#include <TM1637Display.h>
@Crysknife007
Crysknife007 / breathe.html
Created March 7, 2021 20:34
Breathe Sleep Aid CSS Animation
<title>Breathe</title>
<style>
@keyframes breathe {
from { background-color: black; }
to { background-color: red; }
}
body {
@Crysknife007
Crysknife007 / code.py
Created July 23, 2022 19:49
Firefly Simulator for Pi Pico in Circuit Python
# Pi Pico Firefly Simulator
# By Spike Snell 2022
# Import what we need to run the onboard led
import time, board, pwmio, random, microcontroller
# Create a pseudorandom frequency
freq = random.randint(2000,200000)
# Set up the onboard led
@Crysknife007
Crysknife007 / pico_morse_temperature.py
Created July 17, 2022 15:46 — forked from jay0lee/pico_morse_temperature.py
CircuitPython script for the Raspberry Pi Pico that reads the CPU temperature and displays it in morse code.
# Circuit Python Script that Blinks the Current Temperature in Celsius in Morse Code
# Modified July 2022 by Spike Snell from jay0lee's code below on github:
# https://gist.github.com/jay0lee/e3cec7b2d126e3887c5c899635aeef90
# Import all that we need
import board, digitalio, microcontroller, time
# Define the length of a dot
dot = 0.25
@Crysknife007
Crysknife007 / gboard_morse.md
Created July 21, 2021 15:27 — forked from natevw/gboard_morse.md
A list of Morse code supported by GBoard Android Keyboard

Morse code supported by GBoard Android Keyboard

Google's GBoard software keyboard has a Morse code mode.

Here's what characters it currently supports:

  • .-a
  • -...b
  • -.-.c
  • -..d
@Crysknife007
Crysknife007 / spaceBar.ino
Created July 16, 2021 16:34
Digispark Press Space Bar with Arcade Button
#include "DigiKeyboard.h"
// Define button pin
const int buttonPin = 2;
// Define button state
int buttonState = 0;
// Setup
void setup() {
@Crysknife007
Crysknife007 / sleepyMushroom.sh
Last active March 7, 2021 23:51
Sleep Mushroom Bash Controller
# Run the sleepy mushroom like a dodow sleep aid
# Makes use of WS2812FX Web Interface by kitesurfer1404:
# https://github.com/kitesurfer1404/WS2812FX
# Set animation to fade
curl http://192.168.0.128/set?m=15
# Set color to red
curl http://192.168.0.128/set?c=16711680
@Crysknife007
Crysknife007 / flasher.html
Created November 19, 2020 21:35
Fullscreen Javascript Flasher Clock ( Epilepsy Warning )
<html>
<head>
<title>Javascript Flasher Clock</title>
<script>
// Set up our colors array
const colors = [
'#FFFFFF',
@Crysknife007
Crysknife007 / binaryClock.sh
Created March 24, 2013 19:37
Binary Bash Clock. Relies on bc.
#!/bin/bash
# Binary Bash Clock
# Spike Snell - 2012
while true;
do
clear
hour=$(date +%H)
minute=$(date +%M)
second=$(date +%S)
hour_binary=$(echo "ibase=10;obase=2;$hour" | bc)