Skip to content

Instantly share code, notes, and snippets.

View bernstein7's full-sized avatar

Dmytro Kuzminov bernstein7

View GitHub Profile
@vladyspavlov
vladyspavlov / inverter-monitor.yaml
Last active March 23, 2026 10:46
Must inverter ESPHome configuration for ESP32. More info and the latest version of the config are now in the repo: https://github.com/vladyspavlov/esphome-must-inverter
# More info and the latest version of the config are now in the repo: https://github.com/vladyspavlov/esphome-must-inverter
substitutions:
inverter_id: inverter
updates: 5s
api_key: xxx
ota_password: xxx
esphome:
@troyfontaine
troyfontaine / 1-setup.md
Last active March 29, 2026 15:07
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@bil-bas
bil-bas / fibonacci_enumerator.rb
Last active September 10, 2016 22:01
Fibonacci sequence - using infinite enumerator in Ruby.
# Enumerable Fibonacci sequence
module Fibonacci
class << self
include Enumerable
def [](index)
raise "index must be >= 0" unless index >= 0
raise "index must be an Integer" unless index.is_a? Integer
find.with_index {|n, i| i == index }
@adomokos
adomokos / visitor_pattern_example.rb
Created May 24, 2011 17:28
The Visitor Pattern implementation in Ruby from the Wikipedia example
class CarElement
def accept(visitor)
raise NotImpelementedError.new
end
end
module Visitable
def accept(visitor)
visitor.visit(self)
end
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby