Skip to content

Instantly share code, notes, and snippets.

@bamnet
bamnet / .gitlab-ci.yml
Created June 27, 2025 04:25
Flutter CI/CD
image: ghcr.io/cirruslabs/flutter:latest
stages:
- test
- deploy
unit_tests:
stage: test
cache:
- key:
@bamnet
bamnet / setting.rb
Created September 24, 2025 15:40
Rails Settings
class Setting < ApplicationRecord
validates :key, presence: true, uniqueness: true
# Getter for type casting
def typed_value
case value_type
when "integer" then value.to_i
when "boolean" then value == "true"
when "array", "hash" then JSON.parse(value)
when "string" then value # Default for string