Skip to content

Instantly share code, notes, and snippets.

View antonmi's full-sized avatar

Anton Mishchuk antonmi

  • Kloeckner.i
  • Berlin
View GitHub Profile

User

How I can use memoization technique in the Elixir programming language?

ChatGPT

Memoization is a technique for improving the performance of a function by caching its results for subsequent calls with the same arguments. In Elixir, you can use the :memo module to easily implement memoization.

Here's an example of how to use memoization in Elixir:

@antonmi
antonmi / read-access.sql
Last active January 3, 2020 17:33 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;