I hereby claim:
- I am Dan-Q on github.
- I am dq (https://keybase.io/dq) on keybase.
- I have a public key whose fingerprint is B00A 55DA C3F5 9B51 7CA3 F64F 6342 1D24 3218 A6AC
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/usr/local/rvm/wrappers/ruby-2.3.0@jack-fm-logger/ruby | |
| require 'open-uri' | |
| require 'sqlite3' | |
| require 'nokogiri' | |
| # Load DB, create schema if absent | |
| db = SQLite3::Database.new 'log.db' | |
| db.execute "CREATE TABLE IF NOT EXISTS plays (time INTEGER, artist TEXT, song TEXT);" | |
| # Utility functions |
| This is the source code the the Arduinos powering my GC591VV "You Can't Do It Alone!" cache: | |
| further details can be found at https://danq.me/2014/08/13/gc591vv/ | |
| synchronise_clocks.ino - this program sets the clock on the device to the date and time of | |
| compilation: run it at the same time on both boxes to synchronise them | |
| it_takes_two_cache.ino - this is the program that runs on both boxes when they're to be | |
| deployed to the field; some constants need setting: | |
| * SALT - needs to be set to a random number (the same for both boxes); this helps to prevent |
| /* | |
| * More details can be found at: | |
| * https://danq.me/2018/08/21/graticule-water-coverage-calculator/ | |
| * | |
| * Given a graticule (e.g. 51 -1), returns the percentage water cover | |
| * of that graticule based on pixel colour sampling of OpenStreetMap | |
| * tile data. Change the zoomLevel to sample with more (higher) or less | |
| * (lower) granularity: this also affects the run duration. Higher | |
| * granularity improves accuracy both by working with a greater amount | |
| * of data AND by minimising the impact that artefacts (e.g. text, |
| #!/bin/bash | |
| # The following steps, which were tested on Ubuntu 18.04 LTS and on the Ubuntu-powered Linux for Windows Subsystem on Windows, | |
| # will: | |
| # | |
| # * Compile a recent version of OpenSSL (you can skip this step and use your package maintainer's version if you prefer, but you | |
| # might have to tweak a few bits) | |
| # * Create a separate set of configuration files suitable for configuring a basic CA capable of signing EV certificates | |
| # * Create such a CA (hackerca.local / HackerCA EV Root CA) | |
| # * Create a certificate request for a site, hackersite.local, belonging to company "Barclays PLC [GB]" |
| // Basic Reddit Content Exporter | |
| // Author: Dan Q <https://danq.me/> | |
| // License: The Unlicense <https://unlicense.org/> / Public Domain | |
| // 1. Go to www.reddit.com and log in (logging in means that we don't have to worry about a modhash) | |
| // 2. Edit this script to include YOUR username and the content you want to download | |
| // 3. Paste this script into your browser console | |
| (()=>{ | |
| const username = 'avapoet'; // <-- your username goes here (be sure to be logged in as it, too!) | |
| const content = 'submitted'; // <-- valid options: overview (everything), submitted (posts), comments, |
| #!/usr/bin/env ruby | |
| # frozen_string_literal: true | |
| # encoding: utf-8 | |
| require 'bundler/inline' | |
| gemfile do | |
| source 'https://rubygems.org' | |
| gem 'rotp' | |
| gem 'thor' | |
| end |
| #!/usr/bin/env ruby | |
| # Bundler/Gemfile (inline mode) | |
| require 'bundler/inline' | |
| gemfile do | |
| source 'https://rubygems.org' | |
| gem 'chunky_png' | |
| end | |
| # Check for PNG file passed at command line or error out |
| #!/usr/bin/env ruby | |
| require 'bundler/inline' | |
| # Dependencies: | |
| # * open-uri - load remote URL content easily | |
| # * nokogiri - parse/filter XML | |
| gemfile do | |
| source 'https://rubygems.org' | |
| gem 'nokogiri' | |
| end |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Countdown</title> | |
| <style type="text/css"> | |
| body { | |
| margin: 0; | |
| font-family: sans-serif; | |
| font-size: 8vh; |