Skip to content

Instantly share code, notes, and snippets.

View przbadu's full-sized avatar
🏠
Working from home

Pushpa Raj Badu przbadu

🏠
Working from home
View GitHub Profile
@przbadu
przbadu / pg_restore_heroku_db.md
Last active April 9, 2024 11:18
How to restore postgresql dump file into Heroku application using `pg_restore` command.

Use pg_restore to restore latest dump file

Sometimes heroku pg:copy fails, in that case, we can use pg_restore command

Get the credentials

heroku pg:credentials DATABASE_URL -a <app-name>

Install required brew packages

brew install openssl@1.1 readline libyaml gmp

Note openssl@1.1 and readline needs to be installed, otherwise installation will fail.

.zshrc file configurations

@przbadu
przbadu / bloc_readme.md
Created March 24, 2022 02:21
Bloc, cubit and stream short intro
@przbadu
przbadu / realmExample.js
Created September 23, 2021 07:59
Example of Realm association
const Realm = require("realm");
const Post = {
name: "Post",
properties: {
timestamp: 'date',
content: 'string',
title: "string",
comments: 'Comment[]'
},
};
@przbadu
przbadu / nvim.md
Last active April 7, 2022 07:03
Configure Nvim for Rails development

pull postgres image

docker pull postgres:latest

Run docker container

NOTE: If your local postgres installation is running in port 5432, then bind different port with 5433:5432

@przbadu
przbadu / ActiveRecord::StatementInvalid: PG::NotNullViolation: ERROR: null value in column "id" violates not-null constraint .sql
Last active May 5, 2021 07:31
ActiveRecord::StatementInvalid: PG::NotNullViolation: ERROR: null value in column "id" violates not-null constraint
-- Login to psql and run the following
-- What is the result?
SELECT MAX(id) FROM your_table;
-- Then run...
-- If your_table_id_seq is missing, then first create it
CREATE SEQUENCE tablename_colname_seq;
-- This should be higher than the last result.
@przbadu
przbadu / react_on_docker2.md
Created October 29, 2020 04:31
Docker configuration to run react app

Setup docker to run React app

After setting up docker to generate React app without installing node js in https://gist.github.com/przbadu/4a62a5fc5f117cda1ed5dc5409bd4ac1 It was confusing to some of the devs, how to run react app, so I am creating this as second step to the configuration.

Generate required files in your react project

cd my-react-app
touch Dockerfile Dockerfile.dev docker-compose.yml .dockerignore
@przbadu
przbadu / change_audio_source.md
Created October 21, 2020 05:45
Change audio output source in linux

Get the audio sources

To get complete response

pacmd list-sinks

To get short response