Skip to content

Instantly share code, notes, and snippets.

View Curti-s's full-sized avatar

k1r1m1 Curti-s

View GitHub Profile
@kronaemmanuel
kronaemmanuel / twelve_days_of_xmas.rs
Last active February 14, 2021 14:46
Twelve Days of Christmas Poem on console with Rust
fn main() {
twelve_days_of_xmas();
}
fn twelve_days_of_xmas(){
let days = ["first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "tenth", "eleventh", "twelfth"];
for (day_num, day) in days.iter().enumerate() {
println!("For the {} day of Christmas my true love sent to me", day);
@jonoirwinrsa
jonoirwinrsa / process-bugsnag-sourcemaps.js
Created February 16, 2019 15:18
Upload Create React App sourcemaps to Bugsnag - Complete
const { upload } = require('bugsnag-sourcemaps');
const glob = require('glob');
const fs = require('fs');
const appVersion = require('./package.json').version;
const reportBuild = require('bugsnag-build-reporter');
/**
* Find all of the map files in ./build
*/
function findSourceMaps(callback) {
@angela-d
angela-d / gpg-key-migration.md
Created April 1, 2018 23:57
Move GPG Keys from One Machine to Another

Migrate GPG Keys from One Workstation to Another

Replace [your key] with your key ID

To obtain your key ID

gpg --list-secret-keys --keyid-format LONG

Which returns something like

@AtulKsol
AtulKsol / psql-error-fix.md
Last active April 10, 2024 07:41
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

// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';