Skip to content

Instantly share code, notes, and snippets.

@111000101
111000101 / xmapp-replace-mariadb-with-mysql.md
Created October 14, 2017 03:03 — forked from odan/xmapp-replacing-mariadb-with-mysql.md
XAMPP - Replace MariaDB with MySQL

XAMPP - Replace MariaDB with MySQL

Since XAMPP 5.5.30 and 5.6.14, XAMPP ships MariaDB instead of MySQL. MariaDB is not 100% compatible with MySQL and can be replaced with the "orginal" MySQL server.

Backup

  • Backup the old database into a sql dump file
  • Stop the MariaDB service
  • Rename the folder: c:\xampp\mysql to c:\xampp\mariadb
@ahmed-musallam
ahmed-musallam / compress_pdf.md
Last active April 29, 2025 08:21
How to compress PDF with ghostscript

How to compress PDF using ghostscript

As a developer, it bothers me when someone sends me a large pdf file compared to the number of pages. Recently, I recieved a 12MB scanned document for just one letter-sized page... so I got to googlin, like I usually do, and found ghostscript!

to learn more abot ghostscript (gs): https://www.ghostscript.com/

What we are interested in, is the gs command line tool, which provides many options for manipulating PDF, but we are interested in compressign those large PDF's into small yet legible documents.

credit goes to this answer on askubuntu forum: https://askubuntu.com/questions/3382/reduce-filesize-of-a-scanned-pdf/3387#3387?newreg=bceddef8bc334e5b88bbfd17a6e7c4f9

@thomasantony
thomasantony / greyscale.py
Created April 12, 2017 21:22
A Python script for batch converting images to greyscale
"""Batch convert images to greyscale [by Thomas Antony].
Install dependencies:
pip install pillow docopt
Note: If you do not provide an output path, the generated files will be saved
in a folder named "Converted"
Usage:
greyscale.py <in_path> [<out_path>]
@rkeithhill
rkeithhill / posh-git_config.ps1
Last active February 26, 2023 19:27
Config file for posh-git.
# Import Posh-Git and configure Git prompt
Import-Module posh-git
#Import-Module ~\GitHub\dahlbyk\posh-git\src\posh-git.psd1
#Import-Module ~\GitHub\dahlbyk\posh-git\out\posh-git\1.0.0\posh-git.psd1
# Windows PowerShell doesn't parse `e or `u escape sequences in DQ strings. I added that support to the PS parser in 6.0
if ($PSVersionTable.PSVersion.Major -lt 6) {
$global:GitPromptSettings.WindowTitle = {
param($GitStatus, [bool]$IsAdmin)
@JayRaparla
JayRaparla / batch.bat
Last active April 5, 2024 09:30
batch scripts fundamentals and examples
## list available environment variables
SET
#Useful dynamic variables
%CD% %DATE% %TIME% %RANDOM% %ERRORLEVEL% %CMDEXTVERSION% %CMDCMDLINE% %HIGHESTNUMANODENUMBER%
#The environmental variable %ERRORLEVEL% contains the return code of the last executed program or script.
IF %ERRORLEVEL% NEQ 0 (
REM do something here to address the error
)
# To execute a follow-on command after sucess, we use the && operator:
@ptheywood
ptheywood / gs-windows.md
Last active March 14, 2025 02:43
Instructions for PDF compression via Ghostscript on Windows

Ghostscript PDF compression on Windows

Installation

  1. Download and install Ghostscript for windows (http://downloads.ghostscript.com/public/gs916w32.exe)
  2. Optional - Add the ghostscript directory to the path environment variable
    • Control Panel > System > Advanced System Settings > Environment Variables
    • Add ;C:\Program Files (x86)\gs\gs9.16\bin to th end of the PATH variable

Usage

@jlblancoc
jlblancoc / delete_build_temps.bat
Created November 28, 2013 21:54
Batch (.BAT) script (Windows) to delete all temporary files after compiling a project with Microsoft Visual Studio (Visual C++) or GCC. It finds and removes (recursively in the given directory trees), all files that match any of: *.obj, *.o, *.pch, *.pdb, *.ilk, *.idb, *.gch
REM =======================================================================
REM Batch (.BAT) script (Windows) to delete all temporary files after
REM compiling a project with Microsoft Visual Studio (Visual C++) or GCC.
REM
REM Warning: It also deletes the debug databases, needed to "step into"
REM from a debugger. These files may be really *large*, but if you think
REM you will need them, remove the file for "*.pdb" below.
REM
REM Usage:
REM - Open a terminal (Windows-key + R , type "cmd", press ENTER)
@gimmi
gimmi / Microsoft.PowerShell_profile.ps1
Last active February 17, 2025 17:02
Settings for CMD and PowerShell
# Edit profile with the following command
# notepad $PROFILE
function prompt {
Write-Host -ForegroundColor DarkGray $executionContext.SessionState.Path.CurrentLocation
[char]::ConvertFromUtf32(0x276f) + ' '
}
Invoke-Command -ScriptBlock {
Write-Host " User: " -ForegroundColor DarkGray -NoNewline