Skip to content

Instantly share code, notes, and snippets.

View bangbuiduc's full-sized avatar

Bùi Bằng bangbuiduc

View GitHub Profile

Activate Sublime Text Build 4200 x64

  1. Go to https://hexed.it/
  2. Click Open File in the top left corner, navigate to instalation folder and select sublime_text.exe
  3. On the Search for bar in the left panel, input: 0F B6 51 05 83 F2 01
  4. Now in the editor, click on the first byte (0F) and start replacing each byte by: C6 41 05 01 B2 00 90
  5. Finally, in the top left corner again, click on Save as and replace the old executable file with the newly created one.

Enjoy an Unlimited User License!

#!/bin/bash
# 1. Chặn các popup tương tác và cấu hình tự động restart dịch vụ
export DEBIAN_FRONTEND=noninteractive
export NEEDRESTART_MODE=a
# Kiểm tra quyền root
if [[ $EUID -ne 0 ]]; then
echo "Vui lòng chạy với quyền sudo."
exit 1
#!/bin/bash
# 1. Chặn các popup tương tác và cấu hình tự động restart dịch vụ
export DEBIAN_FRONTEND=noninteractive
export NEEDRESTART_MODE=a
# Script cài MongoDB extension phiên bản 1.17.3 CHO TẤT CẢ PHIÊN BẢN PHP
# Cách compile thủ công riêng biệt → HOÀN TOÀN KHÔNG CONFLICT giữa các version
# Ubuntu 22.04+ (hỗ trợ PHP 7.4, 8.1, 8.2, ...)
@bangbuiduc
bangbuiduc / functions.php
Created July 5, 2021 03:46 — forked from alokstha1/functions.php
WordPress custom pagination with $wpdb->get_results
<?php
$items_per_page = 2;
$page = isset( $_GET['cpage'] ) ? abs( (int) $_GET['cpage'] ) : 1;
$offset = ( $page * $items_per_page ) - $items_per_page;
$query = 'SELECT * FROM '.$table_name;
$total_query = "SELECT COUNT(1) FROM (${query}) AS combined_table";
$total = $wpdb->get_var( $total_query );