Skip to content

Instantly share code, notes, and snippets.

View anovsiradj's full-sized avatar

MDMCDC anovsiradj

View GitHub Profile
@samdark
samdark / how_php_environment_variables_actually_work.md
Last active March 27, 2025 11:50
How PHP Environment Variables Actually work
@sindresorhus
sindresorhus / esm-package.md
Last active December 5, 2025 20:00
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@probonopd
probonopd / Wayland.md
Last active December 6, 2025 19:01
Think twice about Wayland. It breaks everything!

Think twice before abandoning X11. Wayland breaks everything!

Wayland breaks everything! It is binary incompatible, provides no clear transition path with 1:1 replacements for everything in X11, and is even philosophically incompatible with X11. Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Feature comparison

@mgol
mgol / jquery-es6-example.md
Last active November 30, 2024 19:06
jQuery ES6 modules example usage

jQuery source is now authored using ES6 modules. It's possible to use them directly in the browser without any build process.

To test it locally, first clone the jQuery repository:

git clone [email protected]:jquery/jquery.git

Then, write the following index.html file:

@ohoroyoi
ohoroyoi / leaflet_tutorial.html
Created August 27, 2019 08:25
leaflet save to db and retrieve from db
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Leaflet tutorial</title>
</head>
<body>
<script
src="https://code.jquery.com/jquery-2.2.4.js"
@yidas
yidas / js-encode-decode.md
Last active November 26, 2025 21:18
JavaScript HTML Entities Encode & Decode
@voku
voku / .htaccess
Last active October 27, 2025 02:06
.htaccess - example
# [simple.cms] + Apache Server Configs v3.1.0 | MIT License
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
# access to the main server configuration file (which is usually called
# `httpd.conf`), you should add this logic there.
#
# https://httpd.apache.org/docs/current/howto/htaccess.html
# ----------------------------------------------------------------------
@arturmamedov
arturmamedov / standalonepopup.html
Last active May 10, 2023 08:25
elFinder standalonepopup in a new browser window (not modal, colorbox etc.)
<!-- main.html (html input and js for open new window with elFinder for select file) -->
<input type="text" class="form-control" value="" id="idOfInput" onfocus="return openElFinder(event, 'idOfInput');"/>
<script>
$( document ).ready(function() {
window.input_id = '';
window.openElFinder = function (event, input_id) {
event.preventDefault();
window.single = true;
@filipemeneses
filipemeneses / countries.json
Last active November 15, 2025 13:50
List of countries with flag, iso and unicode
[
{
"iso": "AD",
"name": "Andorra",
"unicode": "U+1F1E6 U+1F1E9",
"flag": "🇦🇩"
},
{
"iso": "AE",
"name": "United Arab Emirates",
@yi-jiayu
yi-jiayu / autoreplier.py
Last active November 30, 2025 13:46
Automatic replies for Telegram (Updated for Telethon 1.6.2)
import time
from telethon import TelegramClient, events
# sample API_ID from https://github.com/telegramdesktop/tdesktop/blob/f98fdeab3fb2ba6f55daf8481595f879729d1b84/Telegram/SourceFiles/config.h#L220
# or use your own
api_id = 17349
api_hash = '344583e45741c457fe1862106095a5eb'
# fill in your own details here