Skip to content

Instantly share code, notes, and snippets.

View chrisdrackett's full-sized avatar
🐳

Chris Drackett chrisdrackett

🐳
View GitHub Profile
homekit:
- name: Climate
port: 56335
filter:
include_domains:
- climate
- fan
include_entity_globs:
- fan.*
- climate.*
import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) {
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {};
const [mouseX, mouseY] = useMousePosition();
const positions = { x, y, h, w, mouseX, mouseY };
return (
<div
@chrisdrackett
chrisdrackett / useMousePosition.ts
Created September 17, 2020 19:33 — forked from eldh/useMousePosition.ts
useMousePosition
import * as React from "react";
import { throttle } from "lodash";
/**
* Mouse position as a tuple of [x, y]
*/
type MousePosition = [number, number];
/**
* Hook to get the current mouse position

Failed calculateDatabaseSteps at 2019-11-19T21:04:59.067Z

RPC One-Liner

{"id":2,"jsonrpc":"2.0","method":"calculateDatabaseSteps","params":{"projectInfo":"","assumeToBeApplied":[{"stepType":"CreateEnum","enum":"ItemType","values":["TASK","NOTE","EVENT","CHECKIN"]},{"stepType":"CreateEnum","enum":"LogType","values":["DAILY","MONTHLY","YEARLY"]},{"stepType":"CreateModel","model":"User"},{"stepType":"CreateField","model":"User","field":"id","type":"String","arity":"required"},{"stepType":"CreateDirective","model":"User","field":"id","directive":"default"},{"stepType":"CreateDirectiveArgument","model":"User","field":"id","directive":"default","argument":"","value":"cuid()"},{"stepType":"CreateDirective","model":"User","field":"id","directive":"id"},{"stepType":"CreateDirective","model":"User","field":"id","directive":"unique"},{"stepType":"CreateField","model":"User","field":"createdAt","type":"DateTime","arity":"required"},{"stepType":"CreateDirective","model":"User","field":"createdAt","directive":
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 17,
// font family with optional fallbacks
fontFamily: 'Fira Code, Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// "Inconsolata Awesome",
require('./Loading.sass');
import React from 'react';
import classNames from 'classnames';
import { VelocityTransitionGroup } from 'velocity-react';
/**
* The Loading component should be used if your content needs to wait on data from the server before being rendered.
*

Keybase proof

I hereby claim:

  • I am chrisdrackett on github.
  • I am chrisdrackett (https://keybase.io/chrisdrackett) on keybase.
  • I have a public key whose fingerprint is A6F7 286F E0BE 6F10 C9F6 6883 C1A7 0200 6E54 9575

To claim this, I am signing this object:

import requests
while True:
MODEL = "ME278LL/A"
stores = requests.get('http://store.apple.com/us/retail/availabilitySearch?parts.0=ME278LL%2FA&zip=98033').json()
for store in stores['body']['stores']:
if store[u'partsAvailability'][MODEL]['pickupDisplay'] !='unavailable':
if 'Bellevue' in store['storeDisplayName']:
=iphone($width:320px)
$screen_width: $width
$screen_height: $screen_width * 1.7948717949
$iphone_width: $screen_width * 1.11111
$iphone_height: $screen_height * 1.3261904762
$iphone_buttons: $screen_width * 0.024
.iphone
"""Minify Javascript using `UglifyJS <https://github.com/mishoo/UglifyJS/>`_.
UglifyJS is an external tool written for NodeJS; this filter assumes that
the ``uglifyjs`` executable is in the path. Otherwise, you may define
a ``UGLIFYJS_BIN`` setting.
"""
import subprocess
from webassets.exceptions import FilterError
from webassets.filter import Filter