Skip to content

Instantly share code, notes, and snippets.

View grodzik's full-sized avatar

Paweł Tomak grodzik

View GitHub Profile
"""Map from manufacturer to standard clusters for electric heating thermostats."""
import logging
from zigpy.profiles import zha
import zigpy.types as t
from zigpy.zcl.clusters.general import Basic, Groups, Ota, Scenes, Time
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
@grodzik
grodzik / main.tf
Created August 5, 2019 13:02
Terraform splat expression error
provider "aws" {
}
resource "aws_iam_role" "ecs_instance_role" {
name = "ecs_instance_role"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
>_ terraform apply -var "domain=nonexistantexample.com" -var "subdomain=myapi"
data.aws_route53_zone.domain: Refreshing state...
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
+ aws_acm_certificate.crt
@grodzik
grodzik / git_unpublish
Created August 29, 2012 20:50
git unpublish alias
unpublish = "!sh -c 'if [ -n \"$1\" ]; then CURRENT=$1; else CURRENT=$(git symbolic-ref HEAD); fi; CURRENT=${CURRENT##*refs/heads/}; git push origin :refs/heads/$CURRENT; git config --unset branch.${CURRENT}.merge; git config --unset branch.${CURRENT}.remote;'" --
@grodzik
grodzik / git_publish
Created August 29, 2012 20:45
git publish alias
publish = "!sh -c 'if [ -n \"$1\" ]; then CURRENT=$1; else CURRENT=$(git symbolic-ref HEAD); fi; CURRENT=${CURRENT##*refs/heads/}; echo $CURRENT; git push origin $CURRENT; git config branch.${CURRENT}.merge refs/heads/${CURRENT}; git config branch.${CURRENT}.remote origin;'" --
#!/bin/sh
tmpf=`mktemp`
f=${XDG_DATA_HOME:-$HOME/.local/share}/uzbl/history
sort -k3 $f | awk '{ print $1, $2, $3 }' | uniq -f2 | sort > $tmpf && mv $tmpf $f
#!/bin/bash
#[ -n $1 ] || exit 1
file=$1
timestamp=`date +%s`
sed '/__utm./d' -i $file
IFS="
"
" Filename: formfiller.vim
" Purpose: Vim syntax file
" Language: UZBL form
" Maintainer: Paweł Zuzelski <pawelz@pld-linux.org>
" Paul Tomak (grodzik) <pawel.tomak@gmail.com>
" URL: http://gist.github.com/347641
" Last Change: 2010/03/29
" Version: 1
" For version 5.x: Clear all syntax items
" Vim syntax file
" Language: Uzbl config syntax
" Maintainer: Mason Larobina <mason.larobina@gmail.com>
" Contributors: Gregor Uhlenheuer (kongo2002)
" Pawel Tomak (grodzik) <pawel.tomak@gmail.com>
" Version: 0.1
"
" To install this syntax file place it in your `~/.vim/syntax/` directory.
" To enable automatic uzbl-config file type detection create a new file
" `~/.vim/ftdetect/uzbl.vim` with the following line inside:
#!/bin/sh
# just an example of how you could handle your downloads
# try some pattern matching on the uri to determine what we should do
# Some sites block the default wget --user-agent..
GET="wget --user-agent=Firefox --content-disposition --load-cookies=${HOME}/.local/share/uzbl/cookies.txt -nv "
dest="$HOME/Downloads/"
url="$8"