Skip to content

Instantly share code, notes, and snippets.

@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);
@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 / 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 <nate@natedickson.com>
# 1 August 2018
import os, shutil, errno
# Remove the manuscript images folder before creating book.txt
@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 / weatherfile.rb
Last active June 27, 2017 18:41
Create a one line file with weather info in it. Created as an example for Painless Tmux, updated to be worth using. The Emoji works best on MacOS
#! /usr/bin/env ruby
require 'json'
require 'open-uri'
@api_key = "YOUR_API_KEY"
@lat = "40.520882"
@long= "-111.962284"
forecast = JSON.parse(open("https://api.darksky.net/forecast/#{@api_key}/#{@lat},#{@long}").read)
temp = forecast['currently']['temperature']
icon_text = forecast['currently']['icon']
icon =

Keybase proof

I hereby claim:

  • I am PogiNate on github.
  • I am natedickson (https://keybase.io/natedickson) on keybase.
  • I have a public key whose fingerprint is 9267 405F CA2D 5B0D 51F9 092A FB0B 8022 B199 D5A9

To claim this, I am signing this object:

@PogiNate
PogiNate / leapBlink.rb
Last active August 29, 2015 14:24
A simple little toy to wire the Leap Motion to a Blink(1). Basically I've got two little expensive toys on my desk and I wanted to make them talk to each other.
@PogiNate
PogiNate / battinfo.rb
Last active May 22, 2022 10:25
A simple script to format the output from `pmset -g batt` into a row of stars and icons.
#!/usr/bin/env ruby
# encoding: utf-8
full = "★"
empty = "☆"
battery = "🔋"
plug = "⚡"
star_count = 5
per_star = 100/star_count
@PogiNate
PogiNate / gist:5408412
Created April 17, 2013 22:48
Simple commit hook to update a file. This is mostly for my edification and use, and will probably be of no help to anyone else.
#!/bin/sh
false|tee stats # empty out the stats file
git diff --numstat HEAD HEAD~1 | egrep "txt|rtf|md" >> stats #write the stats file for any text-like files committed.
/Users/username/bin/bookBoard.rb # run a specific ruby script at the end of the commit process
@PogiNate
PogiNate / ndBlog.yml
Created March 21, 2013 11:19
my tmuxinator layout for blogging with Octopress.
# ~/.tmuxinator/ndBlog.yml
project_name: Natedickson_dot_com
project_root: ~/Projects/Blogs/natedickson/octopress
tabs:
- editor:
layout: main-vertical
panes:
- vim
- #zsh at the project root. Useful for issuing rake commands.