Skip to content

Instantly share code, notes, and snippets.

View caius's full-sized avatar
👻

Caius Durling caius

👻
View GitHub Profile

Requirements

  • Apple pencil 2 (just because)
  • USB-C charging (same charger as laptop then)
  • iOS 15 support, and unlikely to be unsupported in iOS 16
  • Wifi/sim card model, so it has GPS included

Models meeting criteria

iPad models with USB-C or Thunderbolt / USB 4 connector

#!/usr/bin/env ruby
#
# SitePinger.rb
# Pings a list of sites
#
# Created by Caius Durling <dev at caius dot name> on 2007-07-16.
# Copyright 2007 Hentan Software.
# Licenced under the Creative Commons Attribution-NonCommercial-ShareAlike 2.0 License.
#
require "sqlite3"
require "active_record"
ActiveRecord::Base.establish_connection(
adapter: "sqlite3",
database: ":memory:",
)
ActiveRecord::Schema.define do
create_table "employees", force: :cascade do |t|
require "net/http"
A_CHUNK_TOO_FAR = Class.new(StandardError)
# @param url [URI] uri to fetch title of
def url_title(url)
title = nil
Net::HTTP.start(url.host, url.port, use_ssl: (url.scheme == "https"), open_timeout: 5, read_timeout: 5) do |http|
request = Net::HTTP::Get.new(url)
@caius
caius / spss_macos.md
Last active November 13, 2020 21:54
IBM SPSS Version 26 on macOS Big Sur
  1. install homebrew - https://brew.sh
brew install openjdk
sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
(check `brew info openjdk` if that's still the correct command)
  1. Check java runs
@caius
caius / thing_spec.rb
Last active September 24, 2020 16:25
require "net/http"
require "json"
require "rspec/autorun"
module Thing
def self.thing(response)
case response
when Net::HTTPSuccess
:ok
when Net::HTTPNotFound
// Callback hell approach
function main() {
console.log("hello from main")
var name = "caius"
sendHello(decorateName(name)) // <- smelly
}
function decorateName(name) {
# five digit number
# two of the digits are the same
# four of the digits are odd
# number is higher than 40010
# number is higher than 45000
# digit sum is 16
# five digit, upper/lower bounds
candidates = (40011..44999).select { |i|
# two digits are the same
@data = {}
def default_src(*args)
if args.first
@data[:default_src] = args.map(&:to_s)
else
@data.delete(:default_src)
end
end
*@*.aaa
*@*.aarp
*@*.abarth
*@*.abb
*@*.abbott
*@*.abbvie
*@*.abc
*@*.able
*@*.abogado
*@*.abudhabi