Skip to content

Instantly share code, notes, and snippets.

$ git remote rm origin
$ git remote add origin git@github.com:aplikacjainfo/proj1.git
$ git config master.remote origin
$ git config master.merge refs/heads/master
# Last commit
git log master..{branch_name} --oneline | tail -1
# First commit
git log master..{branch_name} --oneline | head -1
@joebordes
joebordes / dbuser.md
Created October 6, 2019 11:23
Add MySQL/PGSQL DB user

MYSQL

  • create user 'username'@'localhost' identified by 'user-password';
  • create database dbname;
  • grant all privileges on dbname.* to 'username'@'localhost';
  • flush privileges;

PSQL

  • sudo --login --user postgres
@Luke1982
Luke1982 / finetuning-product-service-autocomplete-corebos.md
Last active July 28, 2021 09:57
Fine-tuning the Products/Services autocomplete

Fine-tuning the Products/Services autocomplete

There has been an update that will allow you to fine-tune the autocomplete for products and services. Let's dive in and explain how you can set the options:

First off: selecting the fields the autocomplete searches in

By default, typing something in the product lines will fire a search in the following fields by default:

Products

  • productname
  • manufacturer part no
  • vendor part no
@tebajanga
tebajanga / LaravelInstaller.sh
Last active February 27, 2019 22:36
Installing Laravel Globally by using Composer for Ubuntu
# Getting composer
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
# Changing permission for .composer directory
sudo chown -R $USER ~/.composer/
# Installing Laravel Global
composer global require "laravel/installer"
# Adding composer to system PATH
@tebajanga
tebajanga / Permission.sh
Last active June 2, 2020 19:56
Adding permission to web folder in Ubuntu
sudo chgrp -R www-data /var/www/html/
sudo find /var/www/html/ -type d -exec chmod g+rx {}
sudo find /var/www/html/ -type d -exec chmod g+rx {} +
sudo find /var/www/html/ -type f -exec chmod g+r {} +
sudo chown -R $USER /var/www/html/
sudo find /var/www/html/ -type d -exec chmod g+s {} +
# Run these commands also, when above commands does not work
sudo usermod -a -G www-data $USER
sudo find /var/www/html/ -type d -exec chmod 775 {} \;
@tebajanga
tebajanga / Content.js
Created November 29, 2018 05:35
Removing Specific Element in Array React
import React, { Component } from 'react';
import * as _ from 'lodash';
class Content extends Component {
state = {
products: [ {id: 1, name: 'some name'},
{ id: 2, name: 'some other name'},
{ id: 3, name: 'some other name 2'},
{ id: 4, name: 'other stuff'},
@tebajanga
tebajanga / GitHub-Forking.md
Created May 22, 2018 22:56 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@sdrew
sdrew / Procfile
Last active July 27, 2021 15:25
Laravel configs for Heroku/Dokku
web: vendor/bin/heroku-php-apache2 public/
@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