Skip to content

Instantly share code, notes, and snippets.

View linhdh's full-sized avatar
😵
I may be slow to respond.

Linh Peach linhdh

😵
I may be slow to respond.
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.
/*
* This sketch will format an SD or SDHC card.
* Warning all data will be deleted!
*
* For SD/SDHC cards larger than 64 MB this
* sketch attempts to match the format
* generated by SDFormatter available here:
*
* http://www.sdcard.org/consumers/formatter/
*
@linhdh
linhdh / drawbrent.sql
Created January 6, 2020 03:49 — forked from SQLAdrian/drawbrent.sql
Let's draw Brent
/*Adrian Sullivan - 2019/11/15 Fun with polygons.*/
/*Thanks to Michael J Swart for all the awesome work on color
https://michaeljswart.com/
*/
DECLARE @tt table(id int identity(0,1), label VARCHAR(50), gg GEOMETRY)
SET NOCOUNT ON
DECLARE @g geometry = 'POLYGON((-121.97087 37.372518,-121.97087 37.372518,-121.970863 37.372517,-121.970845 37.372515,-121.97087 37.372518))'
@linhdh
linhdh / mapnik-v2.2.0-win-32.md
Created July 11, 2019 08:04
Setup Mapnik 2.2.0 release candidate for windows 32 bit
@linhdh
linhdh / trial.key
Created September 12, 2018 07:18 — forked from huqi/trial.key
Beyond Compare 4 license for Mac
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
// See: https://devforums.apple.com/message/1000934#1000934
import Foundation
// Logic
operator prefix ¬ {}
@prefix func ¬ (value: Bool) -> Bool {
return !value
}
@linhdh
linhdh / gist:0f9f2af1685e1f263f1969e6eaf3aec8
Created March 1, 2018 07:22
Setting up a Git server on Windows using Git for Windows and Win32_OpenSSH
You need to download and install:
Win32_OpenSSH
Git for Windows, selecting the "Run Git and included Unix tools from the Windows Command Prompt" when prompted. This option will install a bin folder in Program Files\git that will be placed into your path thus taking possibly taking precedence over other tools.
On Server
Set system environment variable for sshd to pick up the git commands
$gitPath = Join-Path -Path $env:ProgramFiles -ChildPath "git\mingw64\bin"
$machinePath = [Environment]::GetEnvironmentVariable('Path', 'MACHINE')
@linhdh
linhdh / public-stun-list.txt
Created February 20, 2018 08:56 — forked from mondain/public-stun-list.txt
Public STUN server list
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@linhdh
linhdh / Button.cs
Created December 22, 2017 08:36
[Xamarin forms] A button with custom renderer for Android.
using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace GoiXe.CustomControls.Common
{
public class Button2 : Xamarin.Forms.Button
{
public enum TextAlignment
@linhdh
linhdh / getBitmap.cs
Created December 21, 2017 15:21
[Xamarin, Android] Get Bitmap from filename
string imagefileName = "testimage.jpg";
// Remove the file extention from the image filename
imagefileName = imagefileName.Replace(".jpg","").Replace(".png","");
// Retrieving the local Resource ID from the name
int id = (int)typeof(Resource.Drawable).GetField(imagefileName).GetValue(null);
// Converting Drawable Resource to Bitmap
var myImage = BitmapFactory.DecodeResource(Forms.Context.Resources, id);