Skip to content

Instantly share code, notes, and snippets.

View natematykiewicz's full-sized avatar
🚀

Nate Matykiewicz natematykiewicz

🚀
  • Wisconsin, USA
  • 06:01 (UTC -05:00)
View GitHub Profile
@bkeepers
bkeepers / flipper.js
Last active February 4, 2024 10:46
Simple Flipper API for your app
// Plain ol' JavaScript module for fetching feature flags from the server
//
// import { isEnabled } from './flipper.js'
//
// if (await isEnabled("new_feature")) {
// // render new feature
// } else {
// // render old feature
// }
//
import { Controller } from "@hotwired/stimulus"
// use with Rails' `time_Tag` helper like so:
// <%= time_tag campaign.starts_at, campaign.starts_at.to_formatted_s(:short), data: { controller: "localized-time", localized_time_type_value: "datetime-short" } %>
export default class extends Controller {
static targets = [ ]
static values = {
type: String,
style: { type: String, default: 'medium' },
locale: { type: String, default: 'default' },
@AliOsm
AliOsm / .env
Last active May 22, 2025 06:45
Deploy Rails, GoodJob, PostgreSQL, Redis, Memcached, Meilisearch, and ChromaDB on the same server using Kamal.
KAMAL_REGISTRY_PASSWORD=dckr_pat_xXXxx_x0xXxXx-xX-XXX0xX0x-x
RAILS_MASTER_KEY=00x00xxx000xxx000000xx0x000x0x00
POSTGRES_PASSWORD=xXxxx0xXXx0
MEILI_MASTER_KEY=xXxxx0xXXx0
BLAZER_DATABASE_URL=postgres://service:{POSTGRES_PASSWORD}@service-name-postgres:5432/service_production
@kamilogorek
kamilogorek / _screenshot.md
Last active May 29, 2025 21:24
Clutter-free VS Code Setup
image
@scpike
scpike / incompat_71.rb
Last active July 6, 2024 14:09
Check for silent gem incompatibilities in Rails 7.1
#!/usr/bin/env ruby
# Run like `ruby incompat_71.rb ~/path/to/Gemfile.lock`
# From the team at infield.ai
#
PACKAGES = [['activerecord-import', '1.5.0'],
['anycable-rails', '1.4.1'],
['blazer', '3.0.1'],
['bullet', '7.1.2'],
['data_migrate', '9.2.0'],
['database_cleaner-active_record', '2.1.0'],
@stenuto
stenuto / hls.sh
Created November 7, 2024 16:58
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
@mwolson
mwolson / README.md
Last active January 7, 2025 16:11
Ghostty + tmux uniform copy and paste

Ghostty + tmux uniform copy and paste

Explanation

This set of configuration changes achieves the following:

  • Disable automatic copying to clipboard while using the mouse to select text. Instead, the selection is copied when the user types either Ctrl+Shift+c or Super+c (on macOS only) after using the mouse to select text.
  • The Super+c keybinding works by remapping it to Ctrl+Shift+c in ghostty.
  • Ghostty will ignore those keybindings so that tmux can handle them. This allows tmux to copy text cleanly even
@kigster
kigster / ruby-install
Last active February 18, 2025 20:20
Ruby Install Minimal script for MacOS and Linux. You can use it to install a recent Ruby using `rbenv` and `ruby-build`, with Jemalloc & YJIT enabled. Run it like so: `bash -c "$(curl -fsSL https://bit.ly/ruby-install-0-2-1)" -- 3.4.1`
#!/usr/bin/env bash
# vim: ft=bash
#
# © 2025 Konstantin Gredeskoul <kig AT kig.re>
# All rights reserved.
# MIT License.
#
# This script uses rbenv/ruby-build to install Ruby on OS-X or Linux. It configures
# Ruby build flags in such a way to ensure Ruby is linked with libjemalloc (which
# reduces the memory by half) and YJIT enabled. It has been tested on both Linux and