Skip to content

Instantly share code, notes, and snippets.

View adammoisa's full-sized avatar

Adam Moisa adammoisa

View GitHub Profile
@fnimick
fnimick / supabase_profile_sync.sql
Last active April 25, 2024 11:35
Create a `public.profile` table and keep it in sync with supabase `auth.users` for selected fields in both directions.
/**
* USERS
* Note: This table contains user data. Users should only be able to view and update their own data.
* Some data is synced back and forth to `auth.users` as described below.
*
* `full_name`: synced in both directions
* `email`: synced from user metadata to profile only
* `avatar_url`: synced from user metadata to profile only
* `terms_accepted_at`: synced from profile to user metadata only
*/
@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active May 7, 2024 08:06
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@syafiqfaiz
syafiqfaiz / how-to-copy-aws-rds-to-local.md
Last active February 21, 2024 06:00
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@ffdead
ffdead / reflowFixedPositions.js
Created August 27, 2012 08:46
Solved position: fixed scrollTo() bug on iOS
/**
* Causes the browser to reflow all elements on the page.
* Fix for the iOS5 bug where fixed positioned elements are
* unavailable after programmatically calling window.scrollTo()
*
* @autor david@14islands.com
*/
reflowFixedPositions: function () {
document.documentElement.style.paddingRight = '1px';