gaiety / randomAlphaNumeric.js
0 likes
0 forks
1 files
Last active 10 months ago
Great for simple dynamic items, like a dynamic html ID suffix
| 1 | # Returns random a-z0-9 pattern of 9 characters |
| 2 | # Example: qhp050kba |
| 3 | |
| 4 | function randomAlphaNumeric() { |
| 5 | return Math.random().toString(36).slice(2) |
| 6 | } |
gaiety / Phoenix (Elixir) + LitElement + TailwindCSS
0 likes
0 forks
1 files
Last active 10 months ago
Inline import the compiled TailwindCSS and Phoenix LiveView ViewHook and make it available to components
| 1 | import {LitElement, unsafeCSS} from 'lit' |
| 2 | import type {ViewHook} from 'phoenix_live_view' |
| 3 | import styles from '../../../priv/static/assets/app.css?inline' |
| 4 | |
| 5 | declare global { |
| 6 | interface HTMLElement { |
| 7 | LitLiveHook?: ViewHook |
| 8 | } |
| 9 | } |
gaiety / ecto-migration-search-pg_trgm
0 likes
0 forks
1 files
Last active 10 months ago
| 1 | defmodule MyProject.Repo.Migrations.ItemsSearch do |
| 2 | use Ecto.Migration |
| 3 | |
| 4 | def up do |
| 5 | execute "CREATE EXTENSION IF NOT EXISTS pg_trgm;" |
| 6 | |
| 7 | execute """ |
| 8 | CREATE INDEX items_search_index |
| 9 | ON items |
| 10 | USING gin ((name) gin_trgm_ops); |
gaiety / Simple nginx static site docker compose
0 likes
0 forks
1 files
Last active 10 months ago
| 1 | name: nginx-static-site |
| 2 | services: |
| 3 | client: |
| 4 | image: nginx |
| 5 | ports: |
| 6 | - 80:80 |
| 7 | volumes: |
| 8 | - ./:/usr/share/nginx/html |