Skip to content

Instantly share code, notes, and snippets.

View herestomwiththeweather's full-sized avatar
Working from home

Tom Brown herestomwiththeweather

Working from home
View GitHub Profile
tenderlove / mdns.rb
Created November 19, 2023 20:02
Sample mDNS client in Ruby
# mDNS client
# Usage: ruby script.rb "_http._tcp.local."
require "socket"
require "ipaddr"
require "fcntl"
require "resolv"
module DNSSD
# to create the plot in this tweet:
font_add_google(name = "Jost", family = "jost")
require 'apple_id'
# NOTE: in debugging mode, you can see all HTTPS request & response in the log.
# AppleID.debug!
pem = <<-PEM
voxpelli / main.js
Last active April 19, 2022 12:43
A recursive Promise.all() that works on objects
const zipObject = function (keys, values) {
const result = {};
keys.forEach((key, i) => {
result[key] = values[i];
return result;
chriseth /
Last active December 26, 2023 09:13
Async Solidity Contracts

Having seen @pirapira's sketch of Bamboo ( ), which proposed to add better control about the "smart contract program flow", even across calls, I thought that this should certainly be added to Solidity, and actually, it might even be possible now to a certain degree using inline assembly.

The problem is that with many functions in a contract, it is not always clear which can be called at which stage in the contract's lifetime. Certain smart contracts would be easier to understand if written as follows:

jmccartie /
Created May 3, 2016 22:03
Patch ImageMagick on Heroku

Patch ImageMagick on Heroku

  • Create a new file on your project: .magick/policy.xml
  • Add the following to its contents:
  <policy domain="coder" rights="none" pattern="EPHEMERAL" />
  <policy domain="coder" rights="none" pattern="URL" />
  <policy domain="coder" rights="none" pattern="HTTPS" />
atcuno / gist:3425484ac5cce5298932
Last active March 25, 2024 13:55
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents