Skip to content

Instantly share code, notes, and snippets.

View adammoisa's full-sized avatar

Adam Moisa adammoisa

View GitHub Profile
@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 [email protected]
*/
reflowFixedPositions: function () {
document.documentElement.style.paddingRight = '1px';
@syafiqfaiz
syafiqfaiz / how-to-copy-aws-rds-to-local.md
Last active November 13, 2024 14:24
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
@Jonalogy
Jonalogy / handling_multiple_github_accounts.md
Last active November 14, 2024 08:31
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

@fnimick
fnimick / supabase_profile_sync.sql
Last active September 27, 2024 03:14
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
*/