Skip to content

Instantly share code, notes, and snippets.

@matt2005
matt2005 / lambda_function.py
Last active April 23, 2024 21:37 — forked from awarecan/lambda_function.py
Alexa Smart Home Skill Adapter for Home Assistant
"""
Copyright 2019 Jason Hu <awaregit at gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@kmorcinek
kmorcinek / .gitignore
Last active April 23, 2024 21:36
.gitignore for C# projects
# The following command works for downloading when using Git for Windows:
# curl -LOf http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore
#
# Download this file using PowerShell v3 under Windows with the following comand:
# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore
#
# or wget:
# wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore
# User-specific files
#! /bin/sh
gap=4
PANEL_HEIGHT=22
BORDER_WIDTH=2
export gap
export PANEL_HEIGHT
export BORDER_WIDTH
#This creates negative padding equal to window gap so that gaps are shown only between windows and not on desktop edges.
bspc config window_gap $gap;
@sifatulrabbi
sifatulrabbi / bd_districts_areas.json
Created January 30, 2022 12:40
List of all the districts with areas of Bangladesh
[
{
"district": "Dhaka",
"areas": [
"Mohammadpur (Dhaka)",
"Dhanmondi - Rd 3",
"Gulshan",
"Kallyanpur",
"Shyamoli",
"Adabor",
@hakib
hakib / time_limited_paginator.py
Last active April 23, 2024 21:31
CountTimeoutLimitPaginator - Paginator that enforced a timeout on the count operation.
class TimeLimitedPaginator(Paginator):
"""
Paginator that enforced a timeout on the count operation.
When the timeout is reached a "fake" large value is returned instead,
Why does this hack exist? On every admin list view, Django issues a
COUNT on the full queryset. There is no simple workaround. On big tables,
this COUNT is extremely slow and makes things unbearable. This solution
is what we came up with.
"""
@andersevenrud
andersevenrud / README.md
Last active April 23, 2024 21:30
Strømpris Sensor i Home Assistant

Strømpris i Home Assistant

Det er mulig å legge til strømpris som en sensor i Home Assistant takket være https://www.hvakosterstrommen.no/ .

Dette vil ikke reflektere ditt abonnement, men gjør det enkelt å få et estimat i forbruksdata / energi panelet.

Konfigurasjon

Tilgjenglige områder:

@simonrenger
simonrenger / memoy_managment_cpp_resource_list.md
Last active April 23, 2024 21:30
C++ Memory Management Resource List
# tar_custom_format_arrow.R
# store as parquet, load as an Arrow Table
format_arrow_table <- function() {targets::tar_format(
read = function(path) {arrow::read_parquet(path, as_data_frame = FALSE)},
write = function(object, path) {arrow::write_parquet(object, path, version = "2.0")},
marshal = function(object) as.data.frame(object),
unmarshal = function(object) arrow::Table$create(object),
repository = "default"