Skip to content

Instantly share code, notes, and snippets.

View edgarv09's full-sized avatar

Edgar Villamarin edgarv09

View GitHub Profile
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.
@searls
searls / do-this.js
Created May 24, 2020 04:05
How to play web audio that won't interrupt background system-wide audio playback in iOS
let audioContext
export function play (url) {
const AudioContext = window.AudioContext || window.webkitAudioContext
if (!audioContext) audioContext = new AudioContext()
const request = new window.XMLHttpRequest()
request.open('GET', url, true)
request.responseType = 'arraybuffer'
request.addEventListener('load', function (e) {
const source = audioContext.createBufferSource()
source.buffer = audioContext.createBuffer(request.response, false)
@tagliala
tagliala / bash.sh
Last active September 30, 2021 21:39
Postgres 11 - Postgis 3 - brew
# Create postgis.control
/usr/local/opt/postgresql@11/share/postgresql@11/extension/postgis.control
# Manually move files to postgres folder
cp /usr/local/Cellar/postgis/3.0.1/lib/*.so /usr/local/Cellar/postgresql@11/11.7/lib
cp /usr/local/Cellar/postgis/3.0.1/share/postgis/*.* /usr/local/Cellar/postgresql@11/11.7/share/postgresql@11/extension
# Pin formuale
@stettix
stettix / things-i-believe.md
Last active March 20, 2024 17:45
Things I believe

Things I believe

This is a collection of the things I believe about software development. I have worked for years building backend and data processing systems, so read the below within that context.

Agree? Disagree? Feel free to let me know at @JanStette. See also my blog at www.janvsmachine.net.

Fundamentals

Keep it simple, stupid. You ain't gonna need it.

@jdnichollsc
jdnichollsc / ABC.md
Last active April 16, 2024 03:40
The Job Interview Guide

The Job Interview Guide 💼

And English is a Work in Progress ⌛

@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active March 27, 2024 06:09
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@CodeMaxter
CodeMaxter / auto-setup-scoop.ps1
Created November 15, 2018 06:39
PowerShell script to install a software development environment using scoop package manager
# git
scoop install git
# add the optional 'extras' bucket
scoop bucket add extras
# utils
scoop install colortool cmder 7zip curl sudo coreutils grep cygwin totalcommander nvm paint.net
# colaboration
@withoutwax
withoutwax / ror-api.markdown
Last active January 24, 2024 16:28
Guide on how to create an API-Only Application with Ruby on Rails 5

Creating an API-Only Application with Ruby on Rails

01 - Create a new API-only Rails app

rails new ror-app-name --api

02 - Basic Scaffold

01 - Model

This step is for creating a very basic level of model for us to work in. If you know already, or wish to apply your own custom models with relationships you can skip this step.

@stevenharman
stevenharman / 00_Heroku-Release-Phase-Review-Apps-Rails_README.md
Last active May 23, 2024 04:43
Heroku Release Phase script for managing Rails DB migrations, and playing nice with Review Apps and postdeploy scripts

Heroku Release Phase + Review Apps + Rails

This is a simplified, but fairly thorough, set of scripts and configuration to enable Heroku Release Phase for Rails apps. Further, this particular set up plays nicely with Heroku Review Apps in that the release phase script will:

  1. Fail, loudly, if the DB does not yet exist.
  2. Load the DB schema if the current schema version (as determined by bin/rails db:version) is 0.
  3. Run DB migrations otherwise.

For a "normal" app that usually means it will run the DB migrations.

@slavikdev
slavikdev / cheatsheet.md
Created March 16, 2017 17:54
Rails request path cheatsheet

Rails request path cheatsheet

Full path with query string

>>  request.url
=> "http://localhost:3000/ask-help.amp?hui=pizda"

Virtual path without query string

>>  request.path
=> "/ask-help.amp"