Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ElyDotDev's full-sized avatar
🏠
Working from home

Ely ElyDotDev

🏠
Working from home
View GitHub Profile
@sindresorhus
sindresorhus / esm-package.md
Last active April 23, 2024 09:02
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.
Change region of Xiaomi routers to unlock all channel:
1. Login to ur router in browser.
2. Open a new tab and paste this
http://192.168.31.1/cgi-bin/luci/;stok=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/api/xqsystem/set_country_code?country=CN
get the stok value from login tab and replace it in new tab and then hit enter.
3. Router will reboot automatically and on next login u will see all 5Ghz channel 36~48 and 149~165.
@markerikson
markerikson / appEntryPoint.js
Last active August 1, 2022 07:41
Webpack React/Redux Hot Module Reloading (HMR) example
import React from "react";
import ReactDOM from "react-dom";
import configureStore from "./store/configureStore";
const store = configureStore();
const rootEl = document.getElementById("root");
@mpolci
mpolci / dynamic-redux-sagas.md
Last active January 14, 2022 22:05
Helper function creating a dynamic saga for code splitting with redux-saga

Helper function

This function create a saga that runs the sagas in the startingSagas array and takes the actions with type indicated by changeActionType to replace the running sagas. The replacing actions must have a field sagas cointaining the array with the new sagas.

function createDynamicSaga (changeActionType, startingSagas) {
  function* _start (sagas) {
    try {
      yield sagas
@zachsa
zachsa / pg-cursor iterator example.js
Last active June 23, 2021 20:38
Example of how to create a row iterator using pg-cursor
const createIterator = async sql => {
const client = await pool.connect()
const cursor = client.query(new Cursor(sql))
const batchSize = 100
return (async function getRows(client, cursor, batchSize) {
let done = false
// Get next rows
const rows = await new Promise((resolve, reject) =>
@xar
xar / gist:8a3b0f67d17424f05ecc
Created April 3, 2015 22:42
less responsive mixin
/* Responsive hack - Bootstrap */
@screen-xs: 300px;
@screen-xs-min: @screen-xs;
@screen-phone: @screen-xs-min;
// Small screen / tablet
// Note: Deprecated @screen-sm and @screen-tablet as of v3.0.1
@screen-sm: 620px;
@screen-sm-min: @screen-sm;
@screen-tablet: @screen-sm-min;