Skip to content

Instantly share code, notes, and snippets.

View nexusstar's full-sized avatar
🏔️
Vincit qui se vincit

Petar Nikov nexusstar

🏔️
Vincit qui se vincit
View GitHub Profile
@nexusstar
nexusstar / prompts.csv
Created February 20, 2024 21:16
Prompts
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 4.
"act","prompt"
"Fullstack Software Developer","I want you to act as a software developer. I will provide some specific information about a web app requirements, and it will be your job to come up with an architecture and code for developing secure app with Golang and React. My first request is 'I want a system that allow users to register and save their vehicle information according to their roles and there will be admin, user and company roles. I want the system to use JWT for security'"
"Mathematician","I want you to act like a mathematician. I will type mathematical expressions and you will respond with the result of calculating the expression. I want you to answer only with the final amount and nothing else. Do not write explanations. When I need to tell you something in English, I'll do it by putting the text inside square brackets {like this}. My first expression is: 4+5"
"Regex Generator","I want you to act as a regex generator. Your role is to generate regular expressions that match specific patterns
### This gist is a part of the NestJS Zero to Hero course on Udemy.
### https://www.udemy.com/course/nestjs-zero-to-hero/?referralCode=F672C0C701844DC91F4D
To run PostgreSQL on Docker, run the following in your Terminal:
docker run --name postgres-nest -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres
@nexusstar
nexusstar / update_neovim.sh
Last active October 12, 2021 21:23
Update Neovim nightly: NOTE this install it in ~/.local/bin not in /usr/local/bin
#!/bin/bash
# Colors definitions
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
BOLD=$(tput bold)
NORMAL=$(tput sgr0)
# Check if necessary applications are installed
@nexusstar
nexusstar / LogAllEvents.js
Last active January 12, 2020 09:24
Log all events on page
Object.keys(window).forEach(key => {
if (/^on/.test(key)) {
window.addEventListener(key.slice(2), event => {
console.log(event);
});
}
});
//Note that you can further customize what you want to catch, for example:
///^on(key|mouse)/.test(key)
@nexusstar
nexusstar / .zshrc
Created November 27, 2019 07:43
ZSH configuration WIP
## Options section
setopt correct # Auto correct mistakes
setopt extendedglob # Extended globbing. Allows using regular expressions with *
setopt nocaseglob # Case insensitive globbing
setopt rcexpandparam # Array expension with parameters
setopt nocheckjobs # Don't warn about running processes when exiting
setopt numericglobsort # Sort filenames numerically when it makes sense
setopt nobeep # No beep
setopt appendhistory # Immediately append history instead of overwriting
setopt histignorealldups # If a new command is a duplicate, remove the older one
@nexusstar
nexusstar / check.md
Created August 1, 2018 08:42
Check where is runtime path of neovim

You can check where it is looking for autoload dirs by examining the runtimepath manually with echo &rtp

Open powershell in administrator mode
Navigate to directory C:\Program Files\Docker\Docker\resources
Run the following commands
`powershell -ExecutionPolicy ByPass -File "C:\Program Files\Docker\Docker\resources\MobyLinux.ps1" -destroy`
`powershell -ExecutionPolicy ByPass -File "C:\Program Files\Docker\Docker\resources\MobyLinux.ps1" -create`

Ok folks, I ran into this problem this weekend when my OpenStack environment crashed. Another post about that coming soon on how to recover.

I found a solution that worked for me with a SQL Server instance running under the Ver 15.1 Distrib 10.1.21-MariaDB with Fedora 25 Server as the host. Do not listen to all the other posts that say your database is corrupted if you completely copied your old mariadb-server's /var/lib/mysql directory and the database you are copying is not already corrupted. This process is based on a system where the OS became corrupted but its files were still accessible.

Here are the steps I followed.

Make sure that you have completely uninstalled any current versions of SQL only on the NEW server. Also, make sure ALL mysql-server or mariadb-server processes on the NEW AND OLD servers have been halted by running:

@nexusstar
nexusstar / mariadb.md
Last active June 22, 2018 08:11
MariaDB with unix_socket and whithout

Default install:

MariaDB [(none)]> SELECT host, user, password, plugin FROM mysql.user LIMIT 0,1;
+-----------+------+----------+-------------+
| host      | user | password | plugin      |
+-----------+------+----------+-------------+
| localhost | root |          | unix_socket |
+-----------+------+----------+-------------+
@nexusstar
nexusstar / getpid.md
Last active April 30, 2018 12:25
Get PID and Image Name Windows

Get PID and Image Name

Use only one command:

for /f "tokens=5" %a in ('netstat -aon ^| findstr 9000') do tasklist /FI "PID eq %a"

where 9000 should be replaced by your port number.

The output will contain something like this: