Skip to content

Instantly share code, notes, and snippets.

@andrewsheelan
andrewsheelan / Dockerfile
Created March 14, 2023 18:03
Truffle Ruby - Rails Dockerfile
# truffleruby 22.3.1, like ruby 3.0.3, GraalVM CE Native
FROM ghcr.io/graalvm/truffleruby:22.3.1
WORKDIR /app
# Install updates and tools required for builds
RUN yum update -y && yum install -y gcc-c++ patch readline readline-devel zlib \
zlib-devel libyaml libxml2 xz libffi-devel openssl-devel make bzip2 \
autoconf automake libtool nodejs tzdata libffi libicu-devel git \
postgresql-devel bash wget && yum clean all
@andrewsheelan
andrewsheelan / firebase.rb
Created February 14, 2018 20:18
Ruby Token generator for Firebase Admin SDK
################################################################################################################
# Requires Firebase Database account and a JSON file. This can be placed in config/initalizers if using Rails
# Download it from the account > service area and renamed it as privatekey.json
# Also requires ruby-jwt gem.
# Usage: Firebase.generate_token(uid)
#
# Rule in Firebase to authorize based on user_id for this token (o_payload passes user_id):
# Path: https://#{project_id}.firebaseio.com/users/#{uid}
# {
# "rules": {