Skip to content

Instantly share code, notes, and snippets.

--- up-device.c 2021-07-18 00:27:11.329004126 -0400
+++ up-device-silent.c 2021-07-18 00:27:51.785006055 -0400
@@ -63,6 +63,15 @@
UpDeviceLevel warning_level, battery_level;
UpExportedDevice *skeleton = UP_EXPORTED_DEVICE (device);
+ /* Disable warning notifications for wireless mice with rechargeable batteries */
+ int type = up_exported_device_get_type_ (skeleton);
+ int state = up_exported_device_get_state(skeleton);
+ if (type == UP_DEVICE_KIND_MOUSE && state == UP_DEVICE_STATE_DISCHARGING) {
@guiambros
guiambros / pong.py
Created March 16, 2023 01:59
Pong game created by GPT-4
import pygame
import sys
import random
pygame.init()
# Constants
WIDTH, HEIGHT = 800, 600
PADDLE_WIDTH, PADDLE_HEIGHT = 20, 100
BALL_SIZE = 20