Skip to content

Instantly share code, notes, and snippets.

View mdimai666's full-sized avatar
🏠
Working from home

mdimai666 mdimai666

🏠
Working from home
View GitHub Profile
@mdimai666
mdimai666 / mysql2psql.txt
Created March 2, 2025 20:47
MySQL export to PSQL
.\mysqldump.exe -u root --default-character-set=utf8 -N db_name --result-file=C:\Users\D\Downloads\pn_dump_3.sql --no-create-info --skip-set-charset --compatible=postgresql
//optional
Get-Content .\pn_dump_3.sql | Foreach-Object {$_.Replace("\'", ''')} | Set-Content .\pn_dump_3_apos.sql
& 'C:\Program Files\PostgreSQL\14\bin\psql.exe' -U postgres -f 'C:\Users\d\Downloads\pn_dump_3_apos.sql' db_name
//next in cmd;
SET PGCLIENTENCODING=utf-8
@mdimai666
mdimai666 / editorjs-embed.js
Created February 19, 2025 20:04 — forked from bettysteger/editorjs-embed.js
Editorjs: Overwrite Embed Block Tool to show an input field where you can paste the URL
// Overwrite Embed Block Tool
import EmbedTool from '@editorjs/embed';
export default class Embed extends EmbedTool {
static get toolbox() {
return {
title: 'YouTube',
icon: '<i class="fab fa-youtube"></i>'
};
}
@mdimai666
mdimai666 / vs2022_run_wt.md
Last active May 17, 2024 21:44
Run windows terminal as External tool in Visual Stidio 2022

Extental Tools edit windows

[Menu -> Tools -> External Tools...]

Title = wt

Command = cmd.exe

Arguments = /c start wt -w $(SolutionFileName) --title "$(ProjectFileName)" -d "$(ProjectDir)"

Initial Directory = $(ProjectDir)

@mdimai666
mdimai666 / pwsh_prompt.ps1
Created April 20, 2024 03:15
PowerShell prompt
function prompt
>> {
>> Write-Host ("PS " + $(get-date) +">") -nonewline -foregroundcolor White
>> return " "
>> }
//index.razor
@page "/"
@using HtmlAgilityPack
@using Microsoft.AspNetCore.Components.RenderTree
@using Microsoft.AspNetCore.Components.Rendering
@using System.Text.RegularExpressions
@using System.Reflection
@*<SurveyPrompt Title="How is Blazor working for you?" />*@
@mdimai666
mdimai666 / Deploy.prod.ps1
Created September 8, 2021 00:47
dotnet net5 ssh deploy script
#prerequire config ssh public key
$dateStamp = Get-Date -UFormat "%Y-%m-%d_%H-%M-%S"
$host_destination = "~/web/WebApp/bin/Release/net5.0"
$host_name = "hostname.com"
$Host.PrivateData.ErrorBackgroundColor = "Red"
$Host.PrivateData.ErrorForegroundColor = "White"
echo '>>Deploy'
@mdimai666
mdimai666 / wordpress.nginx.conf
Created May 21, 2020 14:38
NGINX configuration for wordpress
server {
#listen 80;
set $root_path '/var/www/wordpress/';
root $root_path;
index index.php; # index defined to be served under directory
server_name _;
include d_ssl;
@mdimai666
mdimai666 / copy-file-with-newdatename.ps1
Created January 24, 2020 23:02
copy file to one drive with new name for test on device
using namespace System.IO
$oneDriveDir = 'C:\Users\D\OneDrive\AMAI\Share\MR'
Write-Output "copy apk"
$dateStamp = Get-Date -UFormat "%Y-%m-%d_%H-%M-%S"
$fName = 'src-cordova\platforms\android\app\build\outputs\apk\release\app-release.apk'
<VirtualHost *:88>
ServerAdmin [email protected]
ServerName vk.localhost
ServerAlias vk.localhost
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
@mdimai666
mdimai666 / .conkyrc
Created January 10, 2020 21:59
System monitor Conky settings file
conky.config = {
alignment = 'top_right',
background = false,
border_width = 1,
cpu_avg_samples = 2,
default_color = 'cornflowerblue',
default_outline_color = 'white',
default_shade_color = 'white',
double_buffer = true,
draw_borders = false,