Skip to content

Instantly share code, notes, and snippets.

View mbelsky's full-sized avatar
😈
--no-verify

Max Belsky mbelsky

😈
--no-verify
View GitHub Profile
import { useRef, useState, useEffect } from 'react';
// Usage
function App() {
const [hoverRef, isHovered] = useHover();
return (
<div ref={hoverRef}>
{isHovered ? '😁' : '☹️'}
</div>
import {useState, useCallback, useRef} from 'react'
// Hook
const useHover = <T extends HTMLElement>(): [
(node?: T | null) => void,
boolean,
] => {
const [value, setValue] = useState(false)
// Wrap in useCallback so we can use in dependencies below
@mbelsky
mbelsky / android-sdk-setup.sh
Last active August 29, 2015 14:27 — forked from johnjohndoe/android-sdk-setup.sh
Creating symbolic links in Android SDK folder. After Android-Studio resp. IntelliJ will work with Maven and Gradle.
#!/bin/bash
# Author: Tobias Preuss
# Version: 2015-03-26
echo "Creating symbolic links in Android SDK folder"
echo "============================================="
echo
if [ -z "$ANDROID_HOME" ] ; then