Skip to content

Instantly share code, notes, and snippets.

View dwf's full-sized avatar

David Warde-Farley dwf

View GitHub Profile
@ql-owo-lp
ql-owo-lp / state_based_entity_control.yaml
Last active August 4, 2021 20:34
State based Entity Control
blueprint:
name: State Based Entity Control
description: Change the target entity to desired entity state base on the trigger entity's state, illuminance sensor's state, Sun elevation and so on.
domain: automation
input:
trigger_entity:
name: Trigger Entity
description: This entity will trigger the automation.
selector:
entity:
@r3mcos3
r3mcos3 / heating.yaml
Created December 24, 2020 07:27
Home Assistant Blueprint For Heating
blueprint:
name: Heating Control
description: Control your heating with options for person home, if temp is below a specific value, set temp, and heating between specific times.
domain: automation
input:
heating:
name: Climate Device
description: The climate device to use.
selector:
entity:
FROM alpine:3.11 AS build
ARG CHANNEL=unstable
ARG VERSION=0.99.1-127
ARG ARCH=amd64
RUN mkdir /build
WORKDIR /build
RUN apk add --no-cache curl tar
@kastnerkyle
kastnerkyle / markov_lm.py
Last active June 15, 2016 17:15
A simple and effective markov language model of configurable temperature and order
# A reduction of the post by Yoav Goldberg to a script
# https://gist.github.com/yoavg/d76121dfde2618422139
# Author: Kyle Kastner
# License: BSD 3-Clause
# Fun alternate settings
# Download kjv.txt from http://www.ccel.org/ccel/bible/kjv.txt
# python markov_lm.py kjv.txt 5 1.
# Snippet:
# Queen ording found Raguel: I kill.
@mikelove
mikelove / tsne.R
Last active April 6, 2024 01:11
Exploring behavior of t-SNE on linear data
n <- 200
m <- 40
set.seed(1)
x <- runif(n, -1, 1)
library(rafalib)
bigpar(2,2,mar=c(3,3,3,1))
library(RColorBrewer)
cols <- brewer.pal(11, "Spectral")[as.integer(cut(x, 11))]
plot(x, rep(0,n), ylim=c(-1,1), yaxt="n", xlab="", ylab="",
col=cols, pch=20, main="underlying data")
import numpy as np
import theano
import theano.misc.pycuda_init
from pycuda.compiler import SourceModule
import theano.sandbox.cuda as cuda
from theano.sandbox.cuda import GpuOp
class LinearInterpolationCUDAOp(GpuOp):
@bshillingford
bshillingford / arxiv2kindle.ipynb
Last active March 1, 2024 12:50
arxiv2kindle: recompiles an arxiv paper for kindle-sized screens, and sends it to your wifi-enabled kindle
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Implements the 1D fractional-pixel shift operator from
# Condat, L. (2008). FULLY REVERSIBLE IMAGE ROTATION BY 1-D FILTERING. Signal Processing
import numpy as np
from scipy.misc import comb
def make_b(N, tau):
b = np.zeros(N)
@wolever
wolever / git-blast
Last active November 30, 2016 14:24
git-blast: show git branches sorted by last commit date
#!/usr/bin/env python
"""
Shows git branches sorted by last commit date, noting when branch has been
merged:
$ git blast
* master 33 minutes ago
david 4 days ago [M]
unholy-david-payments 4 days ago
handsontable-2 5 days ago