Skip to content

Instantly share code, notes, and snippets.

# Fork from https://gist.github.com/NdR91/5486a1e55101e062c48545395b7dd9a3
blueprint:
name: Frigate - Telegram Notification
description: Create automations to receive Snapshots and Clips from Frigate
domain: automation
input:
camera:
name: Frigate Camera
description: The name of the camera as defined in your frigate configuration (/conf.yml).
target_chat:
@dacer
dacer / hammerspoon.lua
Last active January 11, 2024 09:10
Send a post request when any of your Mac's cameras are on or off. (https://www.hammerspoon.org/)
API_URL = 'http://192.168.1.2:8123/api/services/switch/'
function sendCameraStatusToHomeAssistant(inUse)
print("sending meeting signal: " .. tostring(inUse))
local endpoint = inUse and 'turn_on' or 'turn_off'
local fullUrl = API_URL .. endpoint
local jsonData = '{"entity_id": "switch.your_id"}'
hs.http.post(fullUrl, jsonData, {
['Content-Type'] = 'application/json; charset=utf-8',
// ==UserScript==
// @name Find House Helper - google maps
// @namespace Violentmonkey Scripts
// @match https://www.google.*/maps/*
// @grant none
// @version 1.0
// @author -
// @description 9/4/2022, 1:14:46 PM
// @require https://cdn.jsdelivr.net/npm/@violentmonkey/dom@2
// ==/UserScript==
@dacer
dacer / 1pass_dups_v2.js
Last active August 12, 2022 12:30 — forked from kfatehi/1pass_dups.js
1password duplicate remover
// tested on 1Password CLI 2.6.1 (build #2060102)
// you need `op` tool for this, download it here https://app-updates.agilebits.com/product_history/CLI2
// create items.json like so:
// op item list --format=json | jq > items.json
// then run this script
// this script outputs uuids of dupes as keyed by item title, create, and modified date,
// feed it into the delete command like so:
// node 1pass_dups_v2.js | xargs -I {} op item delete {} --archive
// and your duplicate items will be moved to the Archive.
@dacer
dacer / sgtts.user.js
Created February 1, 2021 10:47
sgtts.user.js
// ==UserScript==
// @name Sgtts
// @namespace https://prog-8.com/
// @version 0.1
// @description Say goodbye to Twitter's sidebar (aka Sgtts)
// @author Dacer
// @grant none
// @match https://twitter.com/*
// ==/UserScript==
// ==UserScript==
// @name Amazon invoice compressor
// @namespace https://dacer.im/
// @version 0.1
// @description Remove amazon invoice page's custom font
// @author Dacer
// @grant none
// @match https://www.amazon.co.jp/gp/css/summary/print.html/*
// ==/UserScript==
@dacer
dacer / kot.user.js
Last active February 2, 2021 08:42
kot.user.js
// ==UserScript==
// @name King of Time modification
// @namespace https://dacer.im/
// @version 0.1
// @description Make Kot be better
// @author Dacer
// @grant none
// @include https://*.kingtime.jp/admin/*
// ==/UserScript==
@dacer
dacer / JMDict.rb
Created February 5, 2018 15:06
translate JMDict
require "sqlite3"
require 'rest-client'
require 'json'
require 'open-uri'
# RestClient.proxy = "http://127.0.0.1:6152"
DB = SQLite3::Database.new "./JMDict(cn+en).sqlite3"
TARGET_LANG = "zh-CN"
def getTranslation(source, currentId)
@dacer
dacer / JapaneseCharacter.java
Created January 20, 2018 06:50 — forked from mediavrog/JapaneseCharacter.java
Simple string conversion from Hiragana to Katakana and vice versa. Uses the JapaneseCharacter class from Duane J. May and combines it with a simple Utility class method to perform the actual conversion.
/**
* JapaneseCharacter contains static functions to do various tests
* on characters to determine if it is one of the various types of
* characters used in the japanese writing system.
* <p/>
* There are also a functions to translate between Katakana, Hiragana,
* and Romaji.
*
* @author Duane J. May <djmay@mayhoo.com>
* @version $Id: JapaneseCharacter.java,v 1.2 2002/04/20 18:10:24 djmay Exp $
@dacer
dacer / ISO-3166.rb
Last active March 3, 2017 06:45
Convert ISO-3166 Country alpha-2 to full name
#Thanks for https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes
require 'json'
require 'rest-client'
TEST_LIST = "AT, BE, BG, CY, CZ, DE, DK, EE, ES, FI, FR, GB, GR, HU, IE, IT, LT, LU, LV, MT, NL, PL, PT, RO, SE, SI, SK, US".split(", ")
JSON_URL = 'https://github.com/lukes/ISO-3166-Countries-with-Regional-Codes/raw/master/slim-2/slim-2.json'
response = RestClient.get(JSON_URL)
json = JSON.parse(response)
puts json.select { |j| TEST_LIST.include?(j["alpha-2"]) }.map { |j| j["name"]}.join("\n")