Skip to content

Instantly share code, notes, and snippets.

@tomerof
tomerof / vue3-pwa.md
Last active April 11, 2025 20:03
To turn a Vue 3 app into a PWA

To turn a Vue 3 app into a PWA, you can follow these steps:

  1. Create a manifest.json file in the public folder of your Vue 3 app. This file contains metadata about your PWA, such as the app name, icon, and theme color. Here's an example:
{
  "name": "My Vue 3 App",
  "short_name": "My App",
  "icons": [
    {
 "src": "img/icons/android-chrome-192x192.png",
@peimelo
peimelo / database.ci.yml
Last active November 6, 2024 15:02
Ruby on Rails Tests - GitHub Actions
# config/database.ci.yml
test:
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
database: <%= ENV["POSTGRES_DB"] %>
username: <%= ENV['POSTGRES_USER'] %>
password: <%= ENV["POSTGRES_PASSWORD"] %>
@jesster2k10
jesster2k10 / README.md
Last active February 11, 2025 17:25
JWT Auth + Refresh Tokens in Rails

JWT Auth + Refresh Tokens in Rails

This is just some code I recently used in my development application in order to add token-based authentication for my api-only rails app. The api-client was to be consumed by a mobile application, so I needed an authentication solution that would keep the user logged in indefinetly and the only way to do this was either using refresh tokens or sliding sessions.

I also needed a way to both blacklist and whitelist tokens based on a unique identifier (jti)

Before trying it out DIY, I considered using:

@Intyre
Intyre / Wahoo_Elemnt.md
Last active April 25, 2025 13:53
Wahoo Elemnt - Tips, tricks and custom images
@zoellner
zoellner / docker-build-private-github.md
Last active July 9, 2024 20:05
Extract Github token for Docker build with private repo

Note: There are better ways to do this by now. Check https://docs.docker.com/develop/develop-images/build_enhancements/#new-docker-build-secret-information for details

In order to access packages in private github repositories a Dockerfile might contain statements like this:

RUN git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
RUN npm install --ignore-scripts --quiet && npm cache clean --force
RUN git config --global --unset url."https://${GITHUB_TOKEN}@github.com/".insteadOf
registers:
- name: L1 Voltage
unit_of_measurement: V
register: 0
data_type: float
precision: 2
count: 2
- name: L2 Voltage
unit_of_measurement: V
register: 2

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@jagrosh
jagrosh / Github Webhook Tutorial.md
Last active May 2, 2025 21:10
Simple Github -> Discord webhook

Step 1 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send commits and other updates

  2. In the settings for that channel, find the Webhooks option and create a new webhook. Note: Do NOT give this URL out to the public. Anyone or service can post messages to this channel, without even needing to be in the server. Keep it safe! WebhookDiscord

Step 2 - Set up the webhook on Github

  1. Navigate to your repository on Github, and open the Settings Settings
@jonyardley
jonyardley / Dockerfile
Last active March 3, 2023 21:12
Precompile Ruby on Rails assets with Docker
ARG ASSET_HOST
RUN bundle exec rake ASSET_HOST=${ASSET_HOST} RAILS_ENV=production assets:precompile