Skip to content

Instantly share code, notes, and snippets.

@boscomonkey
boscomonkey / kafka-acls.error.log
Created January 10, 2025 22:58
Partial stack trace from calling "kafka-acls" on a Confluent Cloud Kafka instance
[2025-01-10 14:28:56,512] WARN [AdminClient clientId=ccloud-java-client-fe690841-bdf7-4231-8340-f78dd6a8cad9] Error connecting to node pkc-rgm37.us-west-2.aws.confluent.cloud:9092 (id: -1 rack: null) (org.apache.kafka.clients.NetworkClient)
java.io.IOException: Channel could not be created for socket java.nio.channels.SocketChannel[closed]
at org.apache.kafka.common.network.Selector.buildAndAttachKafkaChannel(Selector.java:368)
at org.apache.kafka.common.network.Selector.registerChannel(Selector.java:345)
at org.apache.kafka.common.network.Selector.connect(Selector.java:272)
at org.apache.kafka.clients.NetworkClient.initiateConnect(NetworkClient.java:1077)
at org.apache.kafka.clients.NetworkClient.ready(NetworkClient.java:321)
at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.sendEligibleCalls(KafkaAdminClient.java:1270)
at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1530)
at org.apache.kafka.clients.admin.KafkaAdminClient$Admi
@boscomonkey
boscomonkey / 4-hardest-cs-problems.md
Created June 5, 2023 16:55
Four Hardest Problems in Computer Science
  1. Naming
  2. Cache consistency
  3. Off-by-One error
@boscomonkey
boscomonkey / xkcd_password_bookmarklet.js
Last active November 12, 2021 22:28
Bookmarklet to take XKCD password - https://preshing.com/20110811/xkcd-password-generator/ - and turn it into caps, special chars (periods), and numbers.
(
function() {
function massage_xkcd(txt) {
const arry = txt.split(' ');
const randNum = String(Math.random()).slice(2, 5);
const caps = arry.map(word => word.charAt(0).toUpperCase() + word.substring(1));
caps.push(randNum);
return caps.join('.');
}
@boscomonkey
boscomonkey / url-to-qr-code-bookmarklet.js
Created January 28, 2021 03:12
Bookmarklet to display the current URL as a QR-code in a separate popup window (so as to not replace your current window)
javascript:void(
(
function() {
var orig=location.href;
var url='http://chart.apis.google.com/chart?cht=qr&chs=300x250&chl='+encodeURIComponent(orig);
window.open(url,"_blank","width=320,height=270,resizable=yes,status=yes")
}
)()
)
@boscomonkey
boscomonkey / pre-commit.sh
Last active April 17, 2019 02:09
Git pre-commit hook to warn about CSV, TSV, or TXT files with 50 lines or more
#!/bin/bash
# Git pre-commit hook to warn about CSV, TSV, or TXT files with 50
# lines or more. Original example at:
#
# https://codeinthehole.com/tips/tips-for-using-a-git-pre-commit-hook/
# Make sure this script is executable. Installation is simply:
# ln -s pre-commit.sh .git/hooks/pre-commit

Cam settings

Before you do anything, perform a factory reset.

Exposure

Shutter: Auto

Brightness: 44 (factory default)

javascript:$('#branding img').css('width', '40%');jQuery('#ctaMessage').css('display', 'none');
function getString(str, offset) {
return str.split('')
.map(function(ch) {
return String.fromCharCode(ch.charCodeAt(0) + offset);
})
.join('');
}
@boscomonkey
boscomonkey / devise-1.5.3-install.txt
Created March 6, 2012 20:39
Devise 1.5.3 gem installation message
===============================================================================
Some setup you must do manually if you haven't yet:
1. Setup default url options for your specific environment. Here is an
example of development environment:
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
This is a required Rails configuration. In production it must be the
@boscomonkey
boscomonkey / bind_this.js
Created January 21, 2012 21:26
In JavaScript, binds an object to a callback function to use as "this".
// In JavaScript, binds an object to a callback function to use as "this".
//
// When a function is passed as an event callback, "this" is bound to
// the DOM element triggering the event; in other scenarios when a
// function is used as a callback, "this" is bound to the window
// object.
//
// To override the default binding of "this", call bindThis on your
// function. For example:
//