Skip to content

Instantly share code, notes, and snippets.

View sergii's full-sized avatar

Serhii Ponomarov sergii

View GitHub Profile
@sergii
sergii / ZoomMuteButton.ino
Created March 6, 2021 19:22 — forked from HaxNobody/ZoomMuteButton.ino
Physical mute button for Zoom using an ATTiny85/Digispark and the Micronucleus bootloader to allow programming with the Arduino IDE
/*
Thanks to Elliotmade for the inspiration on this project
https://elliotmade.com/2020/04/23/physical-mute-button-for-zoom-meetings/
Refactored by HaxNobody to extend functionalty and add comments for my own understanding
This program will send USB HID keyboard presses to bring the Zoom window into
the foreground and activate microphone and video functions.
* A momentary press on button 1 will toggle mute on or off.
* Press and hold button 1 to activate PTT (Push-to-Talk) functionality.
import { Controller } from 'stimulus'
export default class extends Controller {
static targets = ['overlay']
static values = {
hidden: Boolean
}
static classes = ['hidden', 'shown']
toggle () {
@sergii
sergii / https-during-dev.macos.sh
Created February 22, 2021 18:06 — forked from disintegrator/https-during-dev.macos.sh
Use Caddy, mkcert and dnsmasq to expose your development server over HTTPS
brew install caddy mkcert nss dnsmasq
mkcert -install
mkcert '*.app.test' '*.cdn.test'
# rename the certs and move them under /usr/local/etc/caddy/certs
cat <<EOF > /usr/local/etc/caddy/Caddyfile
*.app.test:443, *.cdn.test:443 {
@sergii
sergii / stimulus.md
Created February 16, 2021 05:55 — forked from mrmartineau/stimulus.md
Stimulus cheatsheet
@sergii
sergii / example.html
Created February 12, 2021 21:13 — forked from devster31/example.html
Bookmark parser for the NETSCAPE-Bookmark-file-1 format in node. Don't hesitate to comment with feedback.
<!DOCTYPE NETSCAPE-Bookmark-file-1>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<!-- This is an automatically generated file.
It will be read and overwritten.
Do Not Edit! -->
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
<DT><A HREF="https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html#//apple_ref/doc/-%20uid/TP40014508" ADD_DATE="1414706885" PRIVATE="0" TAGS="javascript,mac,osx,yosemite">JavaScript for Automation Release Notes</A>
<DD>This article describes JavaScript for Automation, a new feature in OS X Yosemite.
@sergii
sergii / dns_check.rb
Created January 25, 2021 12:37 — forked from colszowka/dns_check.rb
Ruby DNS Check
require 'resolv'
class DnsCheck
attr_reader :host
def initialize(host)
@host = host
end
def a
@a ||= Resolv::DNS.new.getresources(host, Resolv::DNS::Resource::IN::A)
@sergii
sergii / ping.rb
Created January 23, 2021 10:55 — forked from DiogoAndre/ping.rb
Simple ICMP Ping script in Ruby. Using the Net-Ping gem https://github.com/djberg96/net-ping
require 'net/ping'
@icmp = Net::Ping::ICMP.new('142.40.81.34')
rtary = []
pingfails = 0
repeat = 5
puts 'starting to ping'
(1..repeat).each do
if @icmp.ping
@sergii
sergii / ping.rb
Created January 23, 2021 10:55 — forked from DiogoAndre/ping.rb
Simple ICMP Ping script in Ruby. Using the Net-Ping gem https://github.com/djberg96/net-ping
require 'net/ping'
@icmp = Net::Ping::ICMP.new('142.40.81.34')
rtary = []
pingfails = 0
repeat = 5
puts 'starting to ping'
(1..repeat).each do
if @icmp.ping
@sergii
sergii / check-certificate.rb
Created January 23, 2021 07:39 — forked from matiaskorhonen/check-certificate.rb
Check an SSL/TLS certificate in Ruby (with SNI support)
# Modified from:
# http://findingscience.com/ruby/ssl/2013/01/13/reading-an-ssl-cert-in-ruby.html
require "socket"
require "openssl"
host = "www.piranhas.co"
tcp_client = TCPSocket.new("www.piranhas.co", 443)
ssl_client = OpenSSL::SSL::SSLSocket.new(tcp_client)
@sergii
sergii / bootstrap_modal_in_tailwind.html
Created January 22, 2021 17:24 — forked from andreaseriksson/bootstrap_modal_in_tailwind.html
Create a Bootstrap modal with Tailwind CSS
<!-- Button trigger modal -->
<button type="button" class="inline-block font-normal text-center px-3 py-2 leading-normal text-base rounded cursor-pointer text-white bg-blue-600" data-toggle="modal" data-target="#exampleModalTwo">
Launch modal two
</button>
<!-- Modal -->
<div class="modal hidden fixed top-0 left-0 w-full h-full outline-none fade" id="exampleModalTwo" tabindex="-1" role="dialog">
<div class="modal-dialog relative w-auto pointer-events-none max-w-lg my-8 mx-auto px-4 sm:px-0" role="document">
<div class="relative flex flex-col w-full pointer-events-auto bg-white border border-gray-300 rounded-lg">
<div class="flex items-start justify-between p-4 border-b border-gray-300 rounded-t">