Skip to content

Instantly share code, notes, and snippets.

View pr8x's full-sized avatar

Luis von der Eltz pr8x

  • Frankfurt am Main, Germany
  • 20:50 (UTC +02:00)
View GitHub Profile
@pr8x
pr8x / nowis_espnow.ino
Created February 2, 2024 22:08
espnow nowis
#include <WiFi.h>
#include <esp_now.h>
#include <ezButton.h>
#include <esp_wifi.h>
uint8_t globalBroadcastAddress[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
// This is the same message structure as WizMote senders. It's reused here to
// ensure a common parsable payload, but everything other than seq and button
// aren't used by WLED. The ESP-NOW packet has 512 bytes reserved for the message
@pr8x
pr8x / pmc_etw.cpp
Last active February 25, 2023 19:09
#include <cassert>
#include <iostream>
#include <vector>
#include <chrono>
#include <optional>
#include <thread>
#include <mutex>
#include <unordered_map>
#include <algorithm>
#include <random>
constexpr int portable_ffs(uint32_t mask) {
if (std::is_constant_evaluated()) {
if (mask == 0) return 0;
auto count = 1;
while ((mask & 1U) == 0) {
mask >>= 1;
++count;
<UserSettings>
<ApplicationIdentity version="16.0"/>
<ToolsOptions>
<ToolsOptionsCategory name="Environment" RegisteredName="Environment"/>
</ToolsOptions>
<Category name="Environment_Group" RegisteredName="Environment_Group">
<Category name="Environment_FontsAndColors" Category="{1EDA5DD4-927A-43a7-810E-7FD247D0DA1D}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_FontsAndColors" PackageName="Visual Studio Environment Package">
<PropertyValue name="Version">2</PropertyValue>
<FontsAndColors Version="2.0">
<Theme Id="{6C6BEAF0-02CD-4211-A593-E3C571711028}"/>
git log --format='%aE' | sort -u | while read line ; do printf "\n\n%s\n\n" "$line"; \
git grep -l TODO | xargs -n1 git blame -f -n -e -w | grep "$line" | grep TODO | sed "s/.\{9\}//" | sed "s/(.*)[[:space:]]*//"; done | tee todo_log.txt
KeyGetLeftDerivative -filename:FbxMatineeImport.cpp
@pr8x
pr8x / double_buffering.cs
Last active May 30, 2018 17:04
C#: reflection enable double buffering
public static void EnableDoubleBuffering<Control>(Control control)
where Control : System.Windows.Forms.Control
{
typeof(Control).InvokeMember("DoubleBuffered",
BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic,
null, control, new object[] { true });
}
sudo llctl f0 l0 d0
echo "killed network leds"
sudo echo 0 > /sys/class/leds/led0/brightness
sudo echo 0 > /sys/class/leds/led1/brightness
echo "killed flash leds"
mat4 view;
view[0] = vec4(1,0,0,0);
view[1] = vec4(0,1,0,0);
view[2] = vec4(0,0,1,0);
view[3] = vec4(0,0,0,1);
mat4 projection;
vec2 fov = vec2(45.,45.);
float far = 1000.;
float near = .5;
@pr8x
pr8x / NSObject+Predicate.h
Created May 9, 2014 15:56
NSObject+Predicate
#import <Foundation/Foundation.h>
@interface NSObject (Predicate)
/* applies predicate on single object and returns result */
-(BOOL)meetsPredicate:(NSPredicate*)predicate;
@end