Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@FloppyGit
FloppyGit / tradfri_e1743_switch_to_light.yaml
Created December 6, 2023 09:57
Home Assistant Automation Blueprint: Tradfri E1743 Switch to Light via zigbee2mqtt
blueprint:
name: Tradfri E1743 Switch to Light via zigbee2mqtt
description: "Controls a light with a switch given by ENTITY. \n\nShort Button press will toggle light for both Buttons (helpfull in darkness) \n\n Mode set to restart is mandatory for stop after long press to work."
domain: automation
input:
source_switch_e1743_action:
name: Tradfri E1743 Switch
description: The switch-action which triggers this automation.
selector:
entity:
#include <windows.h>
#include <cfgmgr32.h>
int main()
{
DEVINST devParentInst = 0;
DEVINST devInst = 0;
CONFIGRET status = 0;
const DEVINSTID_W PhantomDevNode = (DEVINSTID_W)L"ROOT\\TOASTER\\0000";
const DEVINSTID_W ToasterBasicID = (DEVINSTID_W)L"TOASTER\\BASIC_TOASTER";
@orimanabu
orimanabu / install_podman_on_amazon_linux_2023.sh
Last active April 23, 2024 08:08
Install Podman on Amazon Linux 2023
#!/bin/bash
# To build podman, you have enough resource on the instance.
# I tested this script on t2.xlarge.
topdir=${HOME}/work
mkdir -p ${topdir}
# Install prereq rpms
sudo dnf install -y git golang libseccomp-devel gpgme-devel autoconf automake libtool yajl yajl-devel libcap-devel systemd-devel cni-plugins iptables-nft rpm-build meson golang-github-cpuguy83-md2man.x86_64
@vasanthk
vasanthk / System Design.md
Last active April 23, 2024 08:08
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@OleksiyRudenko
OleksiyRudenko / why-newline.md
Last active April 23, 2024 08:07
Why should text files end with a newline?

Why should text files end with a newline?

Reasons:

  • UNIX standard
  • If the last line in a file doesn't end with a newline then addition of next line affects two lines instead of one. This also pollutes diff on multiple files, so reader may wonder what has changed in a line whereas no significant change has occured.

Multiple newlines at the file end are also redundant as well as spaces at the end of line.

@bbl
bbl / make_variable_check.md
Created July 13, 2019 12:10
Makefile check if variable is defined

Check if variable is defined in a Makefile

Using ifndef

ifndef MY_FLAG
$(error MY_FLAG is not set)
endif
@wojteklu
wojteklu / clean_code.md
Last active April 23, 2024 08:06
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@calpt
calpt / README-OpenCLIP-to-Transformers.md
Last active April 23, 2024 08:05
Convert multilingual LAION CLIP checkpoints from OpenCLIP to Hugging Face Transformers

OpenCLIP -> HF Transformers Conversion

Setup

pip install open_clip_torch transformers

Convert

@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active April 23, 2024 08:02
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@adrianhajdin
adrianhajdin / App.css
Last active April 23, 2024 08:01
Build and Deploy a React Admin Dashboard App With Theming, Tables, Charts, Calendar, Kanban and More
@import url('https://cdn.syncfusion.com/ej2/material.css');
.sidebar {
box-shadow: rgb(113 122 131 / 11%) 0px 7px 30px 0px;
}
.nav-item,
.navbar {
z-index: 10000;
}
@media screen and (max-width:800px) {