Skip to content

Instantly share code, notes, and snippets.

View cowlibob's full-sized avatar
💭
Eyeballing the code

James Cowlishaw cowlibob

💭
Eyeballing the code
View GitHub Profile
@cowlibob
cowlibob / broken-trip-geojson.json
Created March 19, 2024 22:48
Broken trip GeoJSON
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cowlibob
cowlibob / ToneOutputUnit.swift
Created December 30, 2021 22:51 — forked from hotpaw2/ToneOutputUnit.swift
Swift 3 Audio class that can play a simple tone on an iOS device
//
// ToneOutputUnit.swift
//
// This is a Swift 3 class (which should be instantiated as a singleton object)
// that can play a single tone of arbitrary tone and frequency on iOS devices
// using run-time sinewave synthesis and the Audio Unit v3 API with RemoteIO.
//
// Created by Ronald Nicholson rhn@nicholson.com on 2/20/2016.
// revised 2016-Sep-08 for Swift 3
// http://www.nicholson.com/rhn/
require 'pathname'
values1 = Pathname.new('/users/james/advent_of_code_input_1.txt').readlines("\n").map{|l| l.chomp.to_i}.permutation(2).select{|a,b| a + b == 2020}.map{|a, b| {product: a * b, values: [a, b]}}
puts "Part 1"
puts "Output = #{values1.first[:product]}"
values2 = Pathname.new('/users/james/advent_of_code_input_1.txt').readlines("\n").map{|l| l.chomp.to_i}.permutation(3).select{|a,b,c| a + b + c == 2020}.map{|a, b, c| {product: a * b * c, values: [a, b, c]}}
puts "Part 2"
puts "Output = #{values2.first[:product]}"
@cowlibob
cowlibob / AdaptsToSoftwareKeyboard.swift
Created November 14, 2019 00:23
SwiftUI - Modify layout while keyboard is open
//
// AdaptsToSoftwareKeyboard.swift
// Originally from https://stackoverflow.com/questions/56716311/how-to-show-complete-list-when-keyboard-is-showing-up-in-swiftui/58402607#58402607
import Combine
import SwiftUI
struct AdaptsToSoftwareKeyboard: ViewModifier {
@State var currentHeight: CGFloat = 0
{
"metadata": {
"responseInfo": {
"status": 200,
"developerMessage": "OK",
"userMessage": "",
"errorCode": "",
"moreInfo": ""
},
"requestInfo": {
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqmw6b5EViaYrJ1/tfkGpoIf25Z9+6HbYwRcFhSEBxRu6WeFvysU+7FVt9mKW8uXVUeTiItCEiEGvwzcI2ZA1v9Ts2GWhnYAOgYSqWr0sZJ6//ZgfoNsc6Y0GP4VWYP0c5Sj2AjCtnQA+J3sP6ncv/n+rwZcLdc2u9bczumya6F3z8KYRCK+l7wLFXi4oq/7HMWX8/6Pvoma/CqLs3+2QVGfWghb7BPJoJkwjtdKniynD8SqHMxf0HAU+uDKjzR8617yFGFp/aGHnU+q4NCnobj2jRbYSZf0Jq9a3QKyknuDrmZMQ8r1qSbGr2aWJsUcduDgERvG+mIn/CYg37zQYD jamesc@getmorepeoplecycling.com
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "2048-bit RSA, converted by jamescowlishaw@Jamess-MacBook-Pro"
AAAAB3NzaC1yc2EAAAADAQABAAABAQC9SJOtQvSlhNW1P7oqUaTMHS5I3dzjyN3yXZj8X0
e0ztxuzteDR0adpO15+J6wLUgWIGsOw8ZTyUHkpcwtCLyfNH3RoAp6TQycGyOX1hUabwye
GT74th7J3R5ePJllrWqKd2BgX0HCHT0a1Sgb5098fz4g/Ws1M6Yd/W/lR3H7zMbO7j8Lv0
NspkxnlICy2LA4FnvHG3eZbA2NR12GrIo+EwKOjRXKs3FGluHDWw+kCIGBevsO4YX/w9eE
m8f2hALtiP5FRVQdd8p6gDFsYeo2WrebdiZamfytVeIuZ49YBFwwYxwpPfj7XLX/9KZkvP
17MumHYRU3TYiDXsQ3BEZ3
---- END SSH2 PUBLIC KEY ----
✘ ⚙  ~/Projects/lovetoride/lovetoride   master ●  ssh deploy@52.19.46.123 -vvv
OpenSSH_6.9p1, LibreSSL 2.1.7
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 52.19.46.123 [52.19.46.123] port 22.
debug1: Connection established.
debug1: identity file /Users/jamescowlishaw/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
@cowlibob
cowlibob / gist:bf30048a0a23e687560d
Last active August 29, 2015 14:22
Installing boot2docker
correctedtime|vagrant⚡ ⇒ brew install boot2docker
.
.
.
correctedtime|vagrant⚡ ⇒ boot2docker init
.
.
.
correctedtime|vagrant⚡ ⇒ boot2docker up
Waiting for VM and Docker daemon to start...