Skip to content

Instantly share code, notes, and snippets.

View robUx4's full-sized avatar

Steve Lhomme robUx4

View GitHub Profile
@robUx4
robUx4 / rotation android.java
Created August 12, 2015 08:34
Android rotation detection
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
//TouiteurLog.e(false, "onConfigurationChanged");
int newOrientation = newConfig.orientation;
if (mOrientation != newOrientation) {
mOrientation = newOrientation;
if (false && Touiteur.isTablet()) {
// TODO: store whatever state we need
boolean layoutRedone = false;
<intent-filter>
<action android:name="android.intent.action.PACKAGE_CHANGED" />
<data
android:host="com.levelup.touiteur"
android:scheme="package" />
</intent-filter>
@robUx4
robUx4 / bdj.c
Created March 8, 2017 13:12
libbluray LoadLibraryEx
static void *_load_dll(const wchar_t *lib_path, const wchar_t *dll_search_path)
{
void *result;
PVOID WINAPI (*pAddDllDirectory) (PCWSTR);
BOOL WINAPI (*pRemoveDllDirectory)(PVOID);
pAddDllDirectory = (__typeof__(pAddDllDirectory)) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "AddDllDirectory");
pRemoveDllDirectory = (__typeof__(pRemoveDllDirectory)) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "RemoveDllDirectory");
if (pAddDllDirectory && pRemoveDllDirectory) {
@robUx4
robUx4 / ecc-eddsa.c
Created June 21, 2018 09:22
line 146
/* Make sure that the opaque MPI VALUE is in compact EdDSA format.
This function updates MPI if needed. */
gpg_err_code_t
_gcry_ecc_eddsa_ensure_compact (gcry_mpi_t value, unsigned int nbits)
{
gpg_err_code_t rc;
const unsigned char *buf;
unsigned int rawmpilen;
gcry_mpi_t x, y;
unsigned char *enc;
@robUx4
robUx4 / alloca.patch
Created September 26, 2018 14:56
vla MSVC issues
From 72c81fbfa53838a9594137b582b10d99ff385141 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <[email protected]>
Date: Wed, 26 Sep 2018 16:54:27 +0200
Subject: [PATCH] WIP use _alloca() with MSVC
---
src/cdef.c | 4 ++++
src/ipred.c | 3 +++
src/itx.c | 6 ++++++
src/looprestoration.c | 33 +++++++++++++++++++++++++++++++++
@robUx4
robUx4 / gist:f75448aa675d9baaab9015e9c9649318
Last active December 27, 2019 13:59
full log, adding a device after deinstalling deconz add-on and reboot
2019-12-27 14:51:07 DEBUG (MainThread) [zigpy_deconz.uart] Connection made
2019-12-27 14:51:09 DEBUG (MainThread) [zigpy.appdb] Loading application state from /config/zigbee.db
2019-12-27 14:51:09 DEBUG (MainThread) [zigpy.quirks.registry] Checking quirks for None None (00:21:2e:ff:ff:04:81:f2)
2019-12-27 14:51:09 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zigpy.quirks.smartthings.SmartthingsMultiPurposeSensor'>
2019-12-27 14:51:09 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {1} {80, 1}
2019-12-27 14:51:09 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'bellows.zigbee.application.EZSPCoordinator'>
2019-12-27 14:51:09 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {1} {80, 1}
2019-12-27 14:51:09 DEBUG (MainThread) [zigpy.quirks.registry] Considering <class 'zhaquirks.gledopto.soposhgu10.SoposhGU10'>
2019-12-27 14:51:09 DEBUG (MainThread) [zigpy.quirks.registry] Fail because endpoint list mismatch: {11, 13} {
@robUx4
robUx4 / del_merged_branches.py
Last active September 30, 2024 11:36
Script to delete merged branches in git
#!/usr/bin/env python3
# SPDX-License-Identifier: ISC
# Copyright © 2024 VideoLabs, VLC authors and VideoLAN
#
# Authors: Steve Lhomme <[email protected]>
import argparse
import subprocess
import sys