Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"district": "Dhaka", | |
"areas": [ | |
"Mohammadpur (Dhaka)", | |
"Dhanmondi - Rd 3", | |
"Gulshan", | |
"Kallyanpur", | |
"Shyamoli", | |
"Adabor", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
""" |
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.
Tilgjenglige områder:
This is the resource repositry for my memory managment lecture / workshop series at Breda University of applied sciences - Games. It is mainly targeted for game developers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
NewerOlder