Skip to content

Instantly share code, notes, and snippets.

@denis-ismailaj
denis-ismailaj / SwipeToDelete.kt
Last active May 20, 2024 01:01
SwipeToDelete is a boilerplate-free simple implementation of SwipeToDismiss for bidirectional delete gestures in Jetpack Compose.
import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.*
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Delete
@jfierstein
jfierstein / check_mail.py
Created April 22, 2019 05:01
Python script for scraping Gmail inbox for Amazon package emails with today as delivery date (written for Home Assistant)
import sys, smtplib, time
import datetime
import imaplib
import email
import json
EMAIL = "<YOURADDRESS>@gmail.com"
PWD = "<YOURSECRETPASSWORD>"
SMTP_SERVER = "imap.gmail.com"
SMTP_PORT = 993
@mcfrojd
mcfrojd / Shield_Intents.MD
Last active July 23, 2024 03:17
Working INTENTS to use with Community Hass.io Add-ons: Android Debug Bridge for your Nvidia Shield TV

Latest Update 2021-03-06 : New image showing the new "Services" in Home Assistant and got some tips from the comments below.

Credits and thanks: Home Assistant Forum users & Github users: @ocso, @wiphye, @teachingbirds, @tboyce1, @simbesh, @JeffLIrion @ff12 @rebmemer @siaox @DiederikvandenB @Thebuz @clapbr @Finsterclown


Start apps on your android device (in the examples below, my Nvidia Shield TV) from Home Assistant

alt text

Starts Youtube App

entity_id: media_player.shield
command: >-
@frenck
frenck / hassio_ubuntu_install_commands.sh
Last active February 1, 2023 05:38
Simple install command for installing Hass.io on a Generic Ubuntu/Debian machine
Unbuntu is no longer support by the Home Assistant project.
The installation commands previous listed here, are not up 2 date, not recommended, not supported and, therefore, removed.

CEC-Detection

Want to control a TV over HDMI-CEC via a remote RasPi? Include the following as a switch:

platform: command_line
switches:
    tv_power:
      command_on: "ssh pi@<ip_address> -i /home/homeassistant/.homeassistant/id_homeassistant 'echo on 0 | cec-client -s -d 1'"
 command_off: "ssh pi@ -i /home/homeassistant/.homeassistant/id_homeassistant 'echo standby 0 | cec-client -s -d 1'"
@peterbarker
peterbarker / README.md
Created January 23, 2017 06:55 — forked from KonradIT/readme.md
GoPro Studio for Linux

####GoPro Protune correction, timelapse assembling, fisheye removal, slow motion, 4:3 to 16:9 and motion blur in Linux OS - GoPro Studio for Linux - KDEnlive, FFMPEG, ImageMagick, Mencoder and Python!

GoPro Studio has been tremendously useful for GoPro users, but not all GoPro users can enjoy the tool, there is no GoPro Studio for Linux. So some users made their ways to emulate GoPro Studio on Linux.

This guide is more than GoPro Studio, is a must read guide for Linux and GoPro users.

The main features of GoPro Studio are:

  • Convert and edit Protune footage and apply Protune effect.
  • Convert 4:3 footage to 16:9
  • Slow motion
@max-mapper
max-mapper / config.boot
Last active January 31, 2023 09:35
edgerouter lite centurylink fiber pppoe configuration
firewall {
all-ping enable
broadcast-ping disable
ipv6-receive-redirects disable
ipv6-src-route disable
ip-src-route disable
log-martians enable
name WAN_IN {
default-action drop
description "WAN to internal"
@sli
sli / ips.py
Last active January 9, 2024 22:41
Python IPS patcher.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# IPS Patcher
# Copyright (©) itari 2014
# Do whatever you want with this, I don't care. :D
#
# Modified by sli to work on the command line and with
# Python 3. Who even uses Tkinter anymore?
@Jaza
Jaza / Private-pypi-howto
Last active July 2, 2023 16:24
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*
@kissgyorgy
kissgyorgy / sqlalchemy_conftest.py
Last active June 26, 2024 20:01
Python: py.test fixture for SQLAlchemy test in a transaction, create tables only once!
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from myapp.models import BaseModel
import pytest
@pytest.fixture(scope="session")
def engine():
return create_engine("postgresql://localhost/test_database")