Skip to content

Instantly share code, notes, and snippets.

View ravexina's full-sized avatar
💭

Ravexina ravexina

💭
View GitHub Profile
@ravexina
ravexina / fix-git-line-endings
Created August 16, 2023 11:58 — forked from ajdruff/fix-git-line-endings
Forces all line endings to LF in your git repo.
#####################
#
# Use this with or without the .gitattributes snippet with this Gist
# create a fixle.sh file, paste this in and run it.
# Why do you want this ? Because Git will see diffs between files shared between Linux and Windows due to differences in line ending handling ( Windows uses CRLF and Unix LF)
# This Gist normalizes handling by forcing everything to use Unix style.
#####################
# Fix Line Endings - Force All Line Endings to LF and Not Windows Default CR or CRLF
@ravexina
ravexina / postgres-cheatsheet.md
Created May 30, 2021 16:17 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@ravexina
ravexina / lastfm-remove-duplicates.js
Last active March 13, 2020 11:44 — forked from sk22/lastfm-remove-duplicates.js
Last.fm duplicate scrobble deleter
var max = 20; var num = 5; var counter = 1;
var sections = Array.from(document.getElementsByTagName("tbody"));
sections.forEach(function (section) {
var elements = Array.from(section.rows);
var titles = elements.map(function (element) {
var nameElement = element.querySelector('.chartlist-name');
var artistElement = element.querySelector('.chartlist-artist');
return nameElement && artistElement && nameElement.textContent.replace(/\s+/g, ' ').trim()+':'+artistElement.textContent.replace(/\s+/g, ' ').trim();
});