Skip to content

Instantly share code, notes, and snippets.

View bylatt's full-sized avatar

Lattapon Yodsuwan bylatt

  • Bangkok, Thailand
View GitHub Profile
@megaacheyounes
megaacheyounes / huawei_devices_detection_demo.html
Last active March 4, 2025 09:13
Simple example showing the detection of Huawei devices using the UserAgent
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Huawei device detection using user agent</title>
</head>
<body>
<h1 id="h1">Loading...</h1>
@sainnhe
sainnhe / sonokai-alacritty.md
Created January 24, 2022 07:40
Port of sonokai color scheme to alacritty

Installation

Add this to ~/.config/alacritty/alacritty.yml

default

colors:
  primary:
    background: "0x2c2e34"
@fabiolimace
fabiolimace / UUIDv6.sql
Last active April 2, 2025 00:39
Functions for generating UUIDv6 and UUIDv7 on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023-2024 Fabio Lima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@renatorib
renatorib / operator_with_ligatures.md
Last active January 11, 2024 06:45
Using Operator Mono with Fira Code ligatures in Atom.

Using Operator Mono with Fira Code ligatures in Atom.

  1. Open your Atom's Stylesheet
    image

  2. Put this css

atom-text-editor {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
@DeLaGuardo
DeLaGuardo / pragmatapro-font-lock-symbols-v2.el
Last active February 28, 2024 01:27
Snippet for support ligatures from PragmataPro font in Emacs
;; Enable ligatures without prettify-symbols
(provide 'add-pragmatapro-symbol-keywords)
(defconst pragmatapro-fontlock-keywords-alist
(mapcar (lambda (regex-char-pair)
`(,(car regex-char-pair)
(0 (prog1 ()
(compose-region (match-beginning 1)
(match-end 1)
@anoochit
anoochit / gogs.sh
Created March 15, 2016 14:41
gogs.sh config gogs with nginx
APP_NAME="gogs"
MYSQL_PASSWORD="change_me"
HOSTNAME="example.com"
# setup mysql server and database
debconf-set-selections <<CONFIG
mysql-server-5.5 mysql-server/root_password password ${MYSQL_PASSWORD}
mysql-server-5.5 mysql-server/root_password_again password ${MYSQL_PASSWORD}
CONFIG
apt-get install -y --force-yes mysql-server
@tam7t
tam7t / docker-compose.yml
Last active May 18, 2017 14:53
drone-gogs compose
gogs:
image: gogs/gogs:latest
ports:
- "3000:3000"
- "10022:22"
volumes:
- ./data:/data
drone:
image: drone/drone:0.4
# build: .
@mgreau
mgreau / Gogs-Docker.adoc
Last active August 14, 2019 21:42
Gogs Docker Env (docker-compose)

Replace 192.168.99.100 by your DOCKER_HOST IP

# Configure the server
curl 'http://192.168.99.100:3000/install' \
  -H 'Origin: null' -H 'Accept-Encoding: gzip, deflate' \
  -H 'Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4' \
  -H 'Upgrade-Insecure-Requests: 1' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36' \