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
{ | |
"__inputs": [ | |
{ | |
"name": "DS_PROMETHEUS", | |
"label": "Prometheus", | |
"description": "", | |
"type": "datasource", | |
"pluginId": "prometheus", | |
"pluginName": "Prometheus" | |
} |
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
CREATE OR REPLACE FUNCTION escape_json (text) RETURNS text AS $$ | |
SELECT replace($1, '''', '\'''); $$ LANGUAGE SQL IMMUTABLE; | |
CREATE OR REPLACE FUNCTION to_json(text) RETURNS text AS $$ | |
SELECT escape_json($1) $$ LANGUAGE SQL IMMUTABLE; | |
CREATE OR REPLACE FUNCTION to_json(KEY text, value text) RETURNS text AS $$ | |
SELECT '''' || to_json($1) || ''': ''' || to_json($2) || ''''; $$ LANGUAGE SQL IMMUTABLE; |
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
DEBUG_TOOLBAR = DEBUG | |
if DEBUG_TOOLBAR: | |
def show_toolbar(request): | |
if request.user.is_superuser: | |
return True | |
elif request.META['REMOTE_ADDR'] in INTERNAL_IPS: | |
return True | |
return False |
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
// ==UserScript== | |
// @name ibood old prices | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description add prices to old/expired ibood deals | |
// @author You | |
// @match https://www.ibood.com/* | |
// @grant none | |
// ==/UserScript== |
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
// ActiveTable - a bookmarklet to make tables sortable and editable | |
function init() { | |
var aHrows = getHrows(); | |
var numHrows = aHrows.length; | |
var aHidden = getHiddenColumns(); | |
ATpopup = document.createElement("div"); | |
ATpopup.style.cssText = "position: absolute; visibility: hidden; padding: 0; font-family: Arial; background-color: rgba(255, 255, 255, 0.9); border-radius: .5em; text-align: center; box-shadow: .05em .05em .5em #00C;"; |
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
upstream sonarr { | |
server 127.0.0.1:1234; | |
} | |
server { | |
server_name sonarr; | |
include includes.d/restricted.conf; | |
include includes.d/ssl_server.conf; | |
include includes.d/proxy.conf; |
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
# - alias: close curtains | |
# trigger: | |
# - event: sunset | |
# platform: sun | |
# condition: [] | |
# action: | |
# - data: | |
# entity_id: cover.qubino_zmnhod1_flush_shutter_dc_level | |
# service: automation.turn_off |
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
def read(fh, timeout=0): | |
output = [] | |
while select.select([fh], [], [], timeout)[0]: | |
output.append(fh.read(1)) | |
return ''.join(output) |
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
/* vim: ts=8 | |
Example code for the SJ1221 control protocol | |
Based on: http://wp.josh.com/2014/05/11/ws2812-neopixels-made-easy/ | |
*/ | |
// Change this to be at least as long as your pixel string (too long will work fine, just be a little slower) | |
#define PIXELS 96*11 // Number of pixels in the string | |
// color multiplier since we've got 0-4096 instead of 0-256 |
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 | |
exec <"$0" || exit; read v; read v; exec /usr/bin/osascript - "$@"; exit | |
-- the above is some shell trickery that lets us write the rest of | |
-- the file in plain applescript | |
-- Usage: | |
-- For a simple reload and nothing else: | |
-- # sh reload_chrome.sh | |
-- For a reload with activating a different app after (iTerm in this case): | |
-- # sh reload_chrome.sh iTerm |