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 January 5, 2024 07:15
How PHP Environment Variables Actually work
@sindresorhus
sindresorhus / esm-package.md
Last active November 15, 2024 15:20
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.
@mgol
mgol / jquery-es6-example.md
Last active October 12, 2023 10:34
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 April 6, 2022 15:26
JavaScript HTML Entities Encode & Decode
@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 July 29, 2024 07:00
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 January 27, 2024 11:09
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
@maptastik
maptastik / ogrIntoPostGIS.md
Last active March 15, 2024 14:27
Import data into PostGIS with ogr2ogr#

Generally I can use QGIS and its DBManager to import data into a PostGIS database. Sometimes that doesn't work perfectly. ogr2ogr can help though. Here are a few approaches to getting data into PostGIS with ogr2ogr.

This is probably the most basic approach:

 ogr2ogr -f "PostgreSQL" PG:"dbname=<db name> user=<username> password=<password> host=<host> port=<port #>" input.geojson -nln schema.table

Running this little command seems to work if you have need to specify the geometry type (Source):

@azyobuzin
azyobuzin / Dockerfile
Last active November 19, 2020 04:20
Wine 上で Mono を動かすやつ
FROM ubuntu:17.04
# apt-get update がクソ遅いので日本サーバーに変更
RUN sed -i 's|//archive\.ubuntu\.com|//jp\.archive\.ubuntu\.com|g' /etc/apt/sources.list
RUN dpkg --add-architecture i386 && \
apt-get update -y && \
apt-get install -y wget apt-transport-https software-properties-common && \
wget -O - https://dl.winehq.org/wine-builds/Release.key | apt-key add - && \
apt-add-repository -y https://dl.winehq.org/wine-builds/ubuntu/ && \