Skip to content

Instantly share code, notes, and snippets.

@beve
beve / useCollision.js
Created November 6, 2019 15:40
Not optimized react hook to check collision between two elements
import { useState, useEffect, useCallback } from "react"
export default function useCollision(ref1, ref2) {
const [overlap, setOverlap] = useState(null)
const scrollHandler = useCallback(() => {
var rect1 =
ref1.current instanceof Element
? ref1.current.getBoundingClientRect()
: false
@beve
beve / cloudSettings
Created September 12, 2018 00:07
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-09-12T00:07:08.072Z","extensionVersion":"v3.1.2"}
@beve
beve / .gitignore
Created November 15, 2017 10:00 — forked from salcode/.gitignore
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@beve
beve / gist:7948032
Created December 13, 2013 17:35
DOJO SUCKS
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
{
"undef": true,
"strict": false,
"browser": true,
"esnext": false,
"moz": false,
"boss": false,
"node": true,
"dojo": true,
"validthis": true,
@beve
beve / index.js
Last active December 30, 2015 05:39
Raspberry Pi + Nodejs + PIR module + webcam + Philips Hue
var hue = require("node-hue-api");
var HueApi = require("node-hue-api").HueApi;
var gpio = require("gpio");
var nodemailer = require("nodemailer");
/* ************* */
/* CONF */
/* ************* */
var usernameHue = ''; // md5sum