Skip to content

Instantly share code, notes, and snippets.

@DerexScript
DerexScript / html-languages.txt
Created December 24, 2024 22:16 — forked from JamieMason/html-languages.txt
HTML lang attribute / ISO language code reference / Culture names
CULTURE SPEC.CULTURE ENGLISH NAME
--------------------------------------------------------------
Invariant Language (Invariant Country)
af af-ZA Afrikaans
af-ZA af-ZA Afrikaans (South Africa)
ar ar-SA Arabic
ar-AE ar-AE Arabic (U.A.E.)
ar-BH ar-BH Arabic (Bahrain)
ar-DZ ar-DZ Arabic (Algeria)
ar-EG ar-EG Arabic (Egypt)
@DerexScript
DerexScript / https-on-localhost.md
Created December 22, 2024 17:38 — forked from adnan360/https-on-localhost.md
Use HTTPS on Localhost (XAMPP, Windows)

Sometimes some websites require https to work. This can be useful in those cases.

This has been tested with XAMPP (PHP 7.0.8) on Windows 7. Please see the Reference links at the end if in confusion about some step.

STEP 1: Editing Configs

Open:

C:\xampp\php\php.ini
@DerexScript
DerexScript / fetchPostForm.html
Created September 16, 2022 22:49
post using Content-Type application/x-www-form-urlencoded with fetch
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Home</title>
</head>
@DerexScript
DerexScript / kpmToKeePassXC.js
Created September 11, 2022 17:21
kpmToKeePassXC
const readLine = require('readline');
const fs = require('fs');
const regexWN = new RegExp('Website name:\\s([^\n]+)', '');
const regexWU = /Website URL: ([^\n]+)/;
const regexLN = /Login name: ([^\n]+)/;
const regexL = /Login: ([^\n]+)/;
const regexPW = /^Password: ([^\n]+)/;
const regexC = /Comment:/;
@DerexScript
DerexScript / login.php
Created May 20, 2022 05:38
login.php
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, DELETE, PUT, PATCH, OPTIONS');
header('Content-type: application/json');
if (isset($_POST['user']) && isset($_POST['password'])) {
$jsonArr = ["status" => "true", "POST" => $_POST];
echo json_encode($_POST);
} else {
@DerexScript
DerexScript / sendFormDataToServerWithFetch.html
Last active May 20, 2022 05:49
sendFormDataToServerWithFetch.html
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Test Front and Back</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
</head>
// This is an example of how to fetch external data in response to updated props,
// If you are using an async mechanism that does not support cancellation (e.g. a Promise).
class ExampleComponent extends React.Component {
_currentId = null;
state = {
externalData: null
};
@DerexScript
DerexScript / mic-loopback.sh
Created November 29, 2021 06:09 — forked from iamc/mic-loopback.sh
script to enable/disable pulseaudio loopback module in order to get eg. mic feedback
#!/bin/bash
#
# Loads / unloads pulseaudio loopback module in order to eg. be redirect
# mic input to headphones.
#
# Usage: mic-loopback [on|off]
#
if [ $# -ne 1 ]; then
echo "Usage: $0 [on|off]"
@DerexScript
DerexScript / xhr.js
Created October 12, 2021 16:31
xhr.js
var form = new FormData;
var xhr = new XmlHttpRequest;
xhr.open('path/to/api', 'POST', true);
xhr.onreadystatechange = function(e) {
console.log(e); // Check success/fail
}
var toSendData = {
proName: [
'Product 1',
void function() {//closure
var global = this
, _initKeyboardEvent_type = (function( e ) {
try {
e.initKeyboardEvent(
"keyup" // in DOMString typeArg
, false // in boolean canBubbleArg
, false // in boolean cancelableArg
, global // in views::AbstractView viewArg