Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Ely ElyDotDev

🏠
Working from home
View GitHub Profile
View Unlock Xiaomi Routers
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.
@zachsa
zachsa / pg-cursor iterator example.js
Last active Jun 23, 2021
Example of how to create a row iterator using pg-cursor
View pg-cursor iterator example.js
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) =>
@mpolci
mpolci / dynamic-redux-sagas.md
Last active Jan 14, 2022
Helper function creating a dynamic saga for code splitting with redux-saga
View dynamic-redux-sagas.md

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
@markerikson
markerikson / appEntryPoint.js
Last active Aug 1, 2022
Webpack React/Redux Hot Module Reloading (HMR) example
View appEntryPoint.js
import React from "react";
import ReactDOM from "react-dom";
import configureStore from "./store/configureStore";
const store = configureStore();
const rootEl = document.getElementById("root");
View gist:8a3b0f67d17424f05ecc
/* 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;