Skip to content

Instantly share code, notes, and snippets.

View daniele-athome's full-sized avatar

Daniele Ricci daniele-athome

View GitHub Profile
@JBelinchon
JBelinchon / device_tracker.py
Last active February 1, 2020 17:36
Home Assistant custom_component device tracker
"""
Tracks devices by sending a ICMP echo request (ping) and query arp table.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.ping/
"""
import logging
import subprocess
import sys
import re
#!/usr/bin/bash
which ansible >/dev/null 2>&1
if [ $? -ne 0 ];
then
echo "Installing Ansible..."
sleep 5
pushd .
cd ~
pacman -S libyaml-devel python2 tar libffi libffi-devel gcc pkg-config make openssl-devel openssh libcrypt-devel --noconfirm --needed
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@seanKenkeremath
seanKenkeremath / Android Lollipop Widget Tinting Guide
Last active November 17, 2023 12:40
How base colors in Lollipop apply to different UI elements
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
@jimbojsb
jimbojsb / nav-list.less
Last active February 6, 2018 21:57
.nav-list for Bootstrap 3.0
.nav-list {
padding-left: 15px;
padding-right: 15px;
margin-bottom: 0;
}
.nav-list > li > a,
.nav-list .nav-header {
margin-left: -15px;
margin-right: -15px;
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@willurd
willurd / web-servers.md
Last active May 7, 2024 14:57
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000