Choose OpenBSD for your Unix needs. OpenBSD -- the world's simplest and most secure Unix-like OS. A safe alternatve to the frequent vulnerabilities and overengineering of Linux and related software (NGiNX & Apache (httpd-asiabsdcon2015.pdf), OpenSSL, iptables/nftables, systemd, BIND, Postfix, Docker etc.)
OpenBSD -- the cleanest kernel, the cleanest userland and the cleanest config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Controller } from "@hotwired/stimulus" | |
| import SignaturePad from 'signature_pad' | |
| export default class extends Controller { | |
| static targets = ["canvas", "input"] | |
| connect() { | |
| this.signaturePad = new SignaturePad(this.canvasTarget) | |
| this.signaturePad.addEventListener("endStroke", this.endStroke) | |
| this.resizeCanvas() | |
| if (this.inputTarget.value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Controller } from '@hotwired/stimulus' | |
| import autoAnimate from '@formkit/auto-animate' | |
| export default class extends Controller { | |
| connect () { | |
| autoAnimate(this.element) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.addEventListener("turbo:visit", () => { | |
| let main = document.querySelector("main"); | |
| if (main.dataset.turboTransition == "false") return; | |
| let [movement, scale] = ["-12px", "0.99"]; | |
| if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) { | |
| [movement, scale] = ["-6px", "1"] | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Use this validator like this | |
| # | |
| # class User < ApplicationRecord | |
| # validates :profile_link, url: true | |
| # end | |
| class UrlValidator < ActiveModel::EachValidator | |
| def validate_each(record, attribute, value) | |
| unless valid_url?(value) | |
| record.errors.add(attribute, :invalid_url) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Provide a BulletTrain::Theme::FormBuilder, with extensions to | |
| # go between Rails standard form helpers and BulletTrain's themed versions seamlessly. | |
| # With standard Rails: | |
| # form_with model: Post.new do |form| | |
| # form.themed.text_field # Use BulletTrain theming on just one field | |
| # | |
| # form.themed.fields do # Need a nested section of fields but themed? | |
| # end | |
| # end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ruby:3.2.2-alpine | |
| # ============================================================================================================ | |
| # Install system packages | |
| # ============================================================================================================ | |
| RUN apk add --no-cache --update \ | |
| bash \ | |
| build-base \ | |
| curl \ | |
| gcompat \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "bundler/inline" | |
| gemfile(true) do | |
| source "https://rubygems.org" | |
| gem "sqlite3" | |
| gem "enumerable-statistics" | |
| end | |
| require "benchmark" |
I created this to help me run benchmarks/comparisons against Universal ID, but it could serve as the foundation for a robust ETL data pipeline... and it's less than 70 LOC right now! 🤯 🚀
It handles the extract and transform parts of an ETL process and supports the following options:
only- specify which attributes to include
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'sqlite3' | |
| require 'minitest/autorun' | |
| puts "info: gem version: #{SQLite3::VERSION}" | |
| puts "info: sqlite version: #{SQLite3::SQLITE_VERSION}/#{SQLite3::SQLITE_LOADED_VERSION}" | |
| puts "info: sqlcipher?: #{SQLite3.sqlcipher?}" | |
| puts "info: threadsafe?: #{SQLite3.threadsafe?}" | |
| class TestCase < Minitest::Test | |
| def setup |