Skip to content

Instantly share code, notes, and snippets.

@PogiNate
PogiNate / FindAPi.py
Last active April 10, 2017 20:18
A script that lets a raspberry pi tell Pinboard where it is.
import socket
import requests
import sys
import os
name = socket.gethostname()
AUTH_TOKEN = 'YOUR_API_KEY_HERE'
PINBOARD_URL = 'https://api.pinboard.in/v1/posts/add'
FILE_NAME = './ipAddress'
@PogiNate
PogiNate / pre-commit
Last active August 2, 2018 05:56
A pre-commit hook for generating a leanpub book.txt file.
#!/usr/bin/python
# Prep output from Scrivener for publication by Leanpub.
# By Nate Dickson <[email protected]>
# 1 August 2018
import os, shutil, errno
# Remove the manuscript images folder before creating book.txt
@PogiNate
PogiNate / nate2.lua
Last active August 25, 2020 16:43
A simple layout for the Pimoroni Keybow.
-- Sideways Desktop Layout
-- Cord Comes Out Here Cord Comes Out Here
--
-- │ │
-- │ │
-- ▼ ▼
-- ┌────┬────┬────┬────┐ ┌────┬────┬────┬────┐
-- │ 11 │ 8 │ 5 │ 2 │ │LED │ F6 │ F7 │ F8 │ <- Global Shortcuts, Purple
-- │ │ │ │ │ │I/O │ │ │ │
@PogiNate
PogiNate / Markdown to BBCode.js
Last active October 25, 2021 20:52
Some simple markdown to BBCode, in TextBuddy
function pre(text){
// Headings
const h1m = /^#\s(.*\b)\s?(#)?$/gm;
const h1b = `[h1]$1[/h1]`;
text = text.replace(h1m,h1b);
const h2m = /^#{2}\s(.*\b)\s?(#{2})?$/gm;
const h2b = `[h2]$1[/h2]`;
text = text.replace(h2m,h2b);
# Christmas Tree with random lights
# By Nate Dickson
# 19 November 2024
# This code is written in CircuitPython
# For a Raspberry Pi Pico 2040
# But should work for any CircuitPython capable microcontroller.
import board
import digitalio
import time
#
# Module manifest for module 'Personal.GitCommands'
#
# Generated by: Nate Dickson
#
# Generated on: 12/6/2024
#
@{