Skip to content

Instantly share code, notes, and snippets.

View kritish-dhaubanjar's full-sized avatar
🚧
Oh, this was only supposed to be a placeholder

Kritish Dhaubanjar kritish-dhaubanjar

🚧
Oh, this was only supposed to be a placeholder
View GitHub Profile
@sbimochan
sbimochan / unique-branches.md
Last active January 16, 2023 13:36
Get All unique commits going to staging branch from dev or other

Make sure you pulled all the commits in dev and staging branch

Approriately change if needed for master and staging.

git log origin/staging..origin/dev --oneline --no-merges

Press enter and grab all the result in clipboard

Fire up the console

@sbimochan
sbimochan / work.scpt
Last active December 31, 2021 05:14
Daily work flow automation
#!/usr/bin/osascript
tell application "iTerm2"
tell current session of current tab of current window
split vertically with default profile
split vertically with default profile
write text "cd ~/projects/myFavProject"
write text "code ."
end tell
tell second session of current tab of current window
write text "cd ~/projects/myFavProject"
@1mursaleen
1mursaleen / laravel laravel-echo laravel-echo-server private channel authentication problems
Last active December 12, 2023 12:25
Common Problems faced while setting up private channels with laravel-echo & laravel-echo-server.
I'll start with the basics and proceed to addressing the common problems
faced while setting up private channels with laravel-echo & laravel-echo-server.
If you are getting these errors while setup; 401, 403, 419 etc, as I did in my experience.
this gist will help you fix these errors.
Although this gist addresses common problems of laravel-echo-server setup, some problems are similar with Pusher setup.
So it might also be useful if you're having problems with setting up Pusher with Echo.
I'll try to cover eveything and try to use appropriate highlighting to single out each common problem.
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active November 5, 2024 12:03
Online Resources For Web Developers (No Downloading)
@virolea
virolea / upload.js
Last active October 10, 2024 15:11
Tracking file upload progress using axios
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
}
}
let data = new FormData()
data.append('file', files[0])
@AtulKsol
AtulKsol / psql-error-fix.md
Last active November 13, 2024 12:43
Solution of psql: FATAL: Peer authentication failed for user “postgres” (or any user)

psql: FATAL: Peer authentication failed for user “postgres” (or any user)

The connection failed because by default psql connects over UNIX sockets using peer authentication, that requires the current UNIX user to have the same user name as psql. So you will have to create the UNIX user postgres and then login as postgres or use sudo -u postgres psql database-name for accessing the database (and psql should not ask for a password).

If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres (as pointed out by @meyerson answer) will solve your immediate problem.

But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf* line:

from

@nixta
nixta / .htaccess
Last active August 30, 2024 15:29
.htaccess to add CORS to your website
# Add these three lines to CORSify your server for everyone.
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE"
Header set Access-Control-Allow-Headers "Content-Type, Authorization"