Skip to content

Instantly share code, notes, and snippets.

@M0r13n
M0r13n / doh
Last active June 13, 2024 02:03
Setup Cloudflare as a DoH (DNS over HTTPS) resolver on Mikrotik devices (RouterOS v7.0.2+)
# Temporarily add a normal upstream DNS resolver
/ip dns set servers=1.1.1.1,1.0.0.1
# CA certificates extracted from Mozilla
/tool fetch url=https://curl.se/ca/cacert.pem
# Import the downloaded ca-store (127 certificates)
/certificate import file-name=cacert.pem passphrase=""
# Set the DoH resolver to cloudflare
@sindresorhus
sindresorhus / esm-package.md
Last active June 16, 2024 08:41
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.
@danieldunderfelt
danieldunderfelt / MdxContent.js
Created July 10, 2019 05:49
MDX in React-native
// Use your MDX content with this component.
import React from 'react'
import MDX from '@mdx-js/runtime'
import components from '../utils/markdown/markdown'
// Renders a cimple loading spinner as a test
import Loading from './Loading'
const mdxComponents = {
@Pliner
Pliner / import
Last active March 1, 2024 06:22
Mikrotik antifilter.download update script
:do {
:do {
/file remove "/ipsum.rsc";
/file remove "/subnet.rsc";
} on-error={}
:put "Downloading ipsum.rsc...";
:do {
/tool fetch url="https://antifilter.download/list/ipsum.rsc" dst-path="/ipsum.rsc"
} on-error={
@cfra
cfra / eve-ng.md
Created July 10, 2018 13:49
How to install eve-ng on digitalocean

Installing eve-ng on digitalocean

  1. Create an Ubuntu 16.04 Droplet
  2. Set a root passwd
passwd root
@brad-jones
brad-jones / index.js
Created November 7, 2017 08:51
Get a list of required polyfill.io features based on browserslist
const semver = require('semver');
const browserslist = require('browserslist');
const polyFillService = require('polyfill-service');
function browserVersionMatches(browsersListVersion, polyFillServiceVersion)
{
// Do some quick and easy checks first
if (browsersListVersion === polyFillServiceVersion) return true;
if (polyFillServiceVersion === '*') return true;
if (browsersListVersion === 'all') return true;
@wangruohui
wangruohui / Install NVIDIA Driver and CUDA.md
Last active May 17, 2024 09:02
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@cocoaNib
cocoaNib / exportOptionsAdHoc.plist
Last active April 2, 2024 01:41
Xcode build with exportOptionsPlist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>ad-hoc</string>
</dict>
</plist>
Важно!!
После того, как вы добавили обработчик события 'inited:insales:checkout:deliveries'
нужно вызвать событие 'ready:insales:delivery' (можно для document), которое сообщает нам о том, что вы готовы обрабатывать события.
В этом случае если событие 'inited:insales:checkout:deliveries' уже сработало, мы сгенерируем его повторно.
Для вызова событий необходимо использовать CustomEvent
// Для удобства вызова события можно добавить метод jQuery
if (typeof $.fn.triggerCustom !== 'function') {
$.fn['triggerCustom'] = function(type, data, options) {