Skip to content

Instantly share code, notes, and snippets.

View menjaraz's full-sized avatar

Menjanahary menjaraz

View GitHub Profile

Install PostgreSQL on Windows by scoop

Follow the below steps to install the latest version of PostgreSQL on Windows by scoop package manager.

Install PostgreSQL

scoop install postgresql -g

Configure PostgreSQL as a Windows Service

Install MySQL on Windows by scoop

Install latest version of MySQL via scoop package manager on Windows. If you want to install specific version of MySQL, just replace "mysql" with "mysql@version". For example: "mysql@8.1.0".

Install MySQL

scoop install mysql -g

Configure MySQL as a Windows Service

@menjaraz
menjaraz / app.d
Created July 18, 2024 08:26
ProjectEuler: Summation of Primes
import std.stdio : writefln;
void main() {
"%,3?d".writefln('_', 2_000_000.sumOfPrimesBelow);
}
ulong sumOfPrimesBelow(ulong num) {
// Create a dynamic array of booleans initialized to true
bool[] primes = new bool[num];
primes[] = true;
@menjaraz
menjaraz / app.d
Created May 27, 2024 18:46 — forked from KoRiGaN/app.d
Vibe.d REST API
import vibe.d;
import vibe.web.rest;
import std.array;
shared static this()
{
auto router = new URLRouter;
router.get("/", serveStaticFiles("./../client/index.html"))
.get("*", serveStaticFiles("./../client/"));
List Updated 2024 -> https://docwiki.embarcadero.com/RADStudio/Athens/en/Compiler_Versions
{$IFDEF VER80} ShowMessage('Delphi 1');{$ENDIF}
{$IFDEF VER90} ShowMessage('Delphi 2');{$ENDIF}
{$IFDEF VER100} ShowMessage('Delphi 3');{$ENDIF}
{$IFDEF VER120} ShowMessage('Delphi 4');{$ENDIF}
{$IFDEF VER130} ShowMessage('Delphi 5');{$ENDIF}
{$IFDEF VER140} ShowMessage('Delphi 6');{$ENDIF}
use std::convert::Infallible;
use axum::{
async_trait,
extract::FromRequestParts,
http::{request::Parts, Request, header::CONTENT_LENGTH},
middleware::{from_fn, Next},
response::{Html, IntoResponse, IntoResponseParts, Response},
routing::get,
Router, body::{Full, self},
@menjaraz
menjaraz / golang.udl.xml
Created January 25, 2024 06:06 — forked from blinksmith/golang.udl.xml
Notepad++ Syntax Highlight for Go
<NotepadPlus>
<UserLang name="Golang" ext="go" udlVersion="2.1">
<!--
NPP Syntax Highlight for Go
using most used color in NPP for Golang.
Author: blinksmith Version: 0.1.3
Last tested in Notepad++ v7.5.9
Quick start :
Method 1
@menjaraz
menjaraz / app.d
Created January 24, 2024 09:48
nthPrime
import std.stdio: writefln;
import std.math : sqrt, log;
int popCount(int n)
{
n -= (n >>> 1) & 0x55555555;
n = ((n >>> 2) & 0x33333333) + (n & 0x33333333);
n = ((n >> 4) & 0x0F0F0F0F) + (n & 0x0F0F0F0F);
return (n * 0x01010101) >> 24;
@menjaraz
menjaraz / sqlite_static_cpp.md
Created November 21, 2023 06:41 — forked from payalord/sqlite_static_cpp.md
How to add SQLite into your VS project as Static Library

I assume that you already created C++ Win32 project where you want to include SQLite.

  1. Navigate to https://www.sqlite.org/download.html and download latest amalgamation source version of SQLite.
  2. Extract all the files into your project directory, or your include path, or separate path that you will add/added as include path in your project properties.
  3. Run Developer Command Prompt for VS **** which is usually available at Start -> Programs -> Visual Studio **** -> Visual Studio Tools.
  4. Navigate with command prompt to that directory where we extracted our SQLite.
  5. Run next command to compile: cl /c /EHsc sqlite3.c
  6. Run next command to create static library: lib sqlite3.obj
  7. Open properties of your project and add sqlite3.lib to Linker -> Input -> Additional Dependencies.
@menjaraz
menjaraz / build_sqlite3_lib.md
Last active November 21, 2023 03:43 — forked from zeljic/build_sqlite3_lib.md
Build SQLite3 .lib file on windows

How to build SQLite3 .lib file on Windows 10

  1. Download source from source

    For example: source https://www.sqlite.org/2023/sqlite-amalgamation-3440000.zip

  2. Download binary from binary

    For example: binary https://www.sqlite.org/2023/sqlite-dll-win64-x64-3440000.zip

  3. Extract both archives to the same directory