Skip to content

Instantly share code, notes, and snippets.

View vesan's full-sized avatar

Vesa Vänskä vesan

View GitHub Profile
@amkisko
amkisko / Gemfile
Last active June 30, 2025 17:46
ActiveAdmin v4 propshaft, importmap, stimulus, tailwindcss and ActionPolicy configuration
# NOTE: partial content required for Gemfile
gem "rails"
gem "propshaft"
gem "importmap-rails"
gem "stimulus-rails"
gem "tailwindcss-rails"
gem "action_policy"
@dhh
dhh / linux-setup.sh
Last active June 7, 2025 21:00
linux-setup.sh
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT.
#
#
# Libraries and infrastructure
sudo apt update -y
sudo apt install -y \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
@hSATAC
hSATAC / gcp-start-iap-tunnel-ssh-proxy-magic.sh
Last active February 6, 2025 02:13 — forked from netj/gcp-start-iap-tunnel-ssh-proxy-magic.sh
a nifty script for accessing with native SSH your IAP allowed Compute Engine instances
#!/usr/bin/env bash
# ~/.ssh/gcp-start-iap-tunnel-ssh-proxy-magic.sh
# a script to be used as SSH ProxyCommand to allow fully functional SSH access to any Google Cloud Compute Engine VMs allowing IAP access
#
# Author: Jaeho Shin <[email protected]>
# Created: 2022-10-31
# See also:
# - https://gist.github.com/netj/df4f9de1fefd254ab11979be7035b5d0/#readme
# - https://cloud.google.com/iap/docs/using-tcp-forwarding
#
@mitchellh
mitchellh / merge_vs_rebase_vs_squash.md
Last active June 27, 2025 00:20
Merge vs. Rebase vs. Squash

I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.

I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:

@ThimoDEV
ThimoDEV / clear-planetscale-db-drizzle.ts
Created November 6, 2023 09:59
A simple script to clear all the data of your planetscale DB (force-reset from PrismaORM)
// db.ts
import * as schema from "./schema"
export const db = drizzle(connection, { schema })
//reset.ts
async function reset() {
const tableSchema = db._.schema
if (!tableSchema) {
throw new Error("No table schema found")
@amkisko
amkisko / sidekiq_alive.rb
Last active October 15, 2023 08:37
sidekiq_alive simple alternative implementation (gem sidekiq_status_monitor)
# PATH: config/initializers/sidekiq_alive.rb
# AUTHOR: Andrei Makarov (github.com/amkisko)
# NOTE: now available as gem sidekiq_status_monitor (https://rubygems.org/gems/sidekiq_status_monitor)
class SidekiqAliveServer
attr_accessor :workers_size_threshold,
:process_set_size_threshold,
:queues_size_threshold,
:queue_latency_threshold,
@amkisko
amkisko / _slack_button.html.erb
Last active August 24, 2023 13:36
Slack oauth2 omniauth devise implementation
<%=
button_to(omniauth_authorize_path(resource_name, provider),
method: :post,
style: "margin:1rem;align-items:center;color:#fff;background-color:#4A154B;border:0;border-radius:48px;display:inline-flex;font-family:Lato, sans-serif;font-size:16px;font-weight:600;height:48px;justify-content:center;text-decoration:none;width:256px",
"data-turbo": false) do
%>
<svg
xmlns="http://www.w3.org/2000/svg"
style="height:20px;width:20px;margin-right:12px"
viewBox="0 0 122.8 122.8"
@windoverwater
windoverwater / of-cross-link-2-objects.omnifocusjs
Last active September 10, 2024 19:02
Multi-select Omnifocus to Obsidian project/task copy
@kaspth
kaspth / object_proxy.rb
Created June 10, 2023 14:42
Making Ruby better at object proxying, so we don't need to add `user_name` etc. for Law of Demeter.
class Object::Proxy < SimpleDelegator
def initialize(object, **values)
super(object)
@values = values
end
def method_missing(name, ...)
@values.fetch(name) { super }
end
end