Skip to content

Instantly share code, notes, and snippets.

View thienandangthanh's full-sized avatar

Thien An Dang Thanh thienandangthanh

View GitHub Profile
@Hebilicious
Hebilicious / cloudflare-pages-bun.env
Last active June 2, 2024 20:48
Cloudflare Pages and Bun
# Bun is now officially supported and these environments variables are no longer needed. Keeping this gist for legacy purposes.
# SKIP_DEPENDENCY_INSTALL=true
# UNSTABLE_PRE_BUILD=asdf install bun latest && asdf global bun latest && bun i
@hikiko
hikiko / win_line_endings.vim
Created August 15, 2021 17:20
Git "\ No newline at end of file" solution for VIM (*finallyyyyyy*)
" When git complains about line endings with this message:
" \ No newline at end of file
" the easier fix is to use the following VIM command:
set noendofline binary
@andrebrait
andrebrait / keychron_linux.md
Last active September 17, 2024 19:49
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@fktkrt
fktkrt / Elasticsearch + Kibana behind NGINX.MD reverse proxy with TLS.md
Last active September 27, 2023 19:15
Elasticsearch + Kibana behind NGINX reverse proxy with TLS

Prerequirements:

  • Have Elasticseach + Kibana installed
  • Have server.basePath: "/kibana" option configured in your kibana.yml file

i. Install NGINX apt install nginx

ii. Modify nginx.conf

In /etc/nginx/nginx.conf you should have a similar setup:

@Elfocrash
Elfocrash / IntegrationTest.cs
Created July 10, 2019 10:40
ASP.NET Core Integration tests code from my video: https://www.youtube.com/watch?v=7roqteWLw4s
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Tweetbook.Contracts.V1;
using Tweetbook.Contracts.V1.Requests;
using Tweetbook.Contracts.V1.Responses;
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active September 23, 2024 08:26
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

I (437) example: Opening file
I (457) example: File written
I (467) example: Renaming file
I (467) example: Reading file
I (467) example: Read from file: 'Hello SU04G!'
This line will be written into the log file, not to UART
@glegrain
glegrain / uart.c
Last active August 16, 2024 09:41
STM32 printf retarget to UART
/*# 1- Identify the UART interface, GPIO pins and Alternate Function #########*/
/* For example:
* B-L475E-IOT01A:
* PB6 ------> USART1_TX
* PB7 ------> USART1_RX
*
* NUCLEO-L476RG:
* PA2 ------> USART2_TX
* PA3 ------> USART2_RX
*
@androidfred
androidfred / advanced_anki_deck_editing.md
Last active April 27, 2024 04:25
Advanced Anki deck editing made simple (ish)

Advanced Anki deck editing made simple (ish)

Anki is a great open source flashcard app that can be used to learn anything.

This Gist is a full end to end example of how to:

  • export Anki decks from Anki
  • import Anki decks into MySQL
  • edit Anki decks using MySQL
  • export Anki decks from MySQL
@Pendrokar
Pendrokar / spotify.vbs
Last active November 29, 2019 09:48
Spotify playlist play using Vbscript
Set WshShell = WScript.CreateObject("WScript.Shell")
' spotify or user_id_number if playlist is private. ID can be found by using Spotify's Share button
WshShell.Run "spotify:user:<spotify/user_id_number>:playlist:<playlist_code>", 3, false
WScript.sleep 20000
' Change active Window
WshShell.AppActivate "Spotify"
' Start playing selected queue
WshShell.SendKeys " "
' Focus?
WshShell.SendKeys "{ENTER}"