Skip to content

Instantly share code, notes, and snippets.

View Remzi1993's full-sized avatar
🎯
Busy & focusing

Remzi Cavdar Remzi1993

🎯
Busy & focusing
View GitHub Profile
@Remzi1993
Remzi1993 / Kleopatra-startup.xml
Created October 14, 2024 12:26
A task created with Windows Task Scheduler to run Kleopatra at startup in the background
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<URI>\Kleopatra startup</URI>
</RegistrationInfo>
<Triggers>
<LogonTrigger>
<Enabled>true</Enabled>
</LogonTrigger>
</Triggers>
@Remzi1993
Remzi1993 / Xdebug-instructions-Windows
Created May 11, 2024 14:01
Instructions to install Xdebug on Windows
Instructions to install Xdebug on Windows
1. Download php_xdebug-3.3.2-8.3-vs16-x86_64.dll (for thread safe PHP)
2. Move the downloaded file to C:\php\ext, and rename it to php_xdebug.dll
3. Update C:\Program Files\PHP\8.3.7\php.ini and add the line:
zend_extension = xdebug (this only works if extension_dir = "ext" is enabled in php.ini)
Otherwise use full path: zend_extension = "C:\Program Files\PHP\8.3.7\ext\php_xdebug.dll"
@Remzi1993
Remzi1993 / Main.java
Last active October 31, 2022 00:15
Example of a more advanced lock system in Java
package YOUR_PACKAGE_NAME;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
/**
@Remzi1993
Remzi1993 / Main.java
Last active October 31, 2022 00:12
Example of a simple lock file in Java
package YOUR_PACKAGE_NAME;
import java.io.File;
import java.io.IOException;
/**
* Minimal reproducible example (MRE) - Example of a simple lock file.
* @author Remzi Cavdar - [email protected] - <a href="https://github.com/Remzi1993">@Remzi1993</a>
*/
public class Main {
@Remzi1993
Remzi1993 / caspian.css
Last active October 26, 2022 22:49
caspian.css extracted from JavaFX 19 - path: %HOMEPATH%\.m2\repository\org\openjfx\javafx-controls\19\javafx-controls-19-win.jar
/*
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
@Remzi1993
Remzi1993 / modena.css
Last active September 28, 2023 16:49
modena.css extracted from JavaFX 19 - path: %HOMEPATH%\.m2\repository\org\openjfx\javafx-controls\19\javafx-controls-19-win.jar
/*
* Copyright (c) 2009, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
services:
db:
container_name: WordPress-DB
image: mariadb:latest
command: '--default-authentication-plugin=mysql_native_password'
volumes:
- db:/var/lib/mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=somewordpress
@Remzi1993
Remzi1993 / dateExamples.js
Created December 3, 2021 14:52
JavaScript date examples with leading zeroes to date
// Create or parse a new date
let date = new Date();
// YYYY-MM-DD
let dateFormat1 = date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' + date.getDate()).slice(-2);
// DD-MM-YYYY
let dateFormat2 = ('0' + date.getDate()).slice(-2) + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + date.getFullYear();
// Log
console.log(dateFormat1);
@Remzi1993
Remzi1993 / fetchExamples.js
Last active January 30, 2024 06:21
Examples of using native fetch
// Config / constants
const baseUrl = 'http://localhost:4000' || 'example.herokuapp.com' // or use an environment variable like this: process.env.URL || 'http://localhost:4000'
const JWT = 'Whatever-token'
/*
* Examples of using native fetch
* REST API - CRUD convention (Create/POST, Read/GET, Update/modify/PUT/PATCH, Delete/DELETE)
*
**/