Skip to content

Instantly share code, notes, and snippets.

@innat
innat / capture _events.py
Created May 9, 2018 20:30
Capture the mouse click events in Python and OpenCV
# Capture the mouse click events in Python and OpenCV
'''
-> draw shape on any image
-> reset shape on selection
-> crop the selection
run the code : python capture_events.py --image image_example.jpg
'''

Easy Telemetry Disable for 10/11

Prerequisites

  1. Upgrade to Enterprise edition of Windows 10/11 if you are running Home or Pro.
    • You can do this through the Change Edition option in the Extras menu in MAS.

Disabling Telemetry via Group Policy

  1. Open the Group Policy Editor. Search for "Edit Group Policy" in search or run gpedit.msc.
@Alir3z4
Alir3z4 / utils.py
Created August 9, 2016 06:19
Create a hash of a file on upload time and save it for Django FileField/ImageField
def hash_file(file, block_size=65536):
hasher = hashlib.md5()
for buf in iter(partial(file.read, block_size), b''):
hasher.update(buf)
return hasher.hexdigest()
def upload_to(instance, filename):
"""
@skidunion
skidunion / README.md
Last active May 31, 2025 05:34
5700 XT Single GPU passthrough

Single GPU passthrough

Based on the prepare and release scripts: https://gitlab.com/risingprismtv/single-gpu-passthrough

Configuration

  • CPU: AMD Ryzen 7 3700X
  • GPU: AMD Radeon RX 5700 XT
  • System: Manjaro Linux, Kernel 5.12.1

Problems that I've encountered

After installing drivers in the guest, the GPU fails to initialize with code 43

@hi-spatial
hi-spatial / index.html
Created May 31, 2025 01:43
Membangun WebGIS untuk GPS Tracker Real-Time
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Real-time Map Marker</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/leaflet.min.css" />
<style>
* {
box-sizing: border-box;
@lunaczp
lunaczp / zend_vm_opcodes.h
Created January 23, 2017 09:15
php opcode table
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
@withakay
withakay / timemachine-backups-using-usb-passthrough-and-proxmox.md
Last active May 31, 2025 05:18
A quick guide to setting up Time Machine backups with an Ubuntu VM on Proxmox with USB Passthrough

Setting up Time Machine Backups Using Proxmox (v8.2) and Ubuntu (24.04)

This guide assumes you already have a basic Ubuntu 24.04 VM running on Proxmox. If not, you should set that up first. The VM can be fairly minimal; for example, 8GB of storage and 1GB of RAM should suffice.

It also assumes you have a USB Storage device that you want to use for Time Machine backups

Mapping a USB Drive to the Ubuntu VM Using Virtio in Proxmox

Mapping a USB drive via the Proxmox GUI is quick and easy, but the performance may be suboptimal because the driver is emulated. For better performance, it's recommended to use the virtio driver, which is paravirtualized. Paravirtualization allows the guest VM to interact more directly with the hardware, improving I/O performance compared to emulated devices.

@ardakazanci
ardakazanci / navigation3.kt
Created May 21, 2025 16:57
Navigation3 ViewModel Playground Gist with Jetpack Compose
@Serializable
sealed interface ScreenKey : NavKey {
@Serializable object List : ScreenKey
@Serializable data class Detail(val itemId: String) : ScreenKey
}
class DetailViewModel : ViewModel() {
var clickCount by mutableStateOf(0)
fun onClicked() { clickCount++ }
@AGDholo
AGDholo / 0
Last active May 31, 2025 05:38
cursor + tailwindcss4 + claude 4 网页设计最美提示词
## Cursor AI 设计规则配置指南
## 重要提示:请配置使用 context7 https://github.com/upstash/context7 来让 claude 生成的代码处于最新版本。
你需要安装的库:
tailwindcss v4 ,@motion(非 framer motion)
需要安装的 mcp:
@emmaxd00
emmaxd00 / notas.md
Last active May 31, 2025 04:56
My first gists

GitHub Gist stars