Skip to content

Instantly share code, notes, and snippets.

View nip10's full-sized avatar
🎯
Focusing

Diogo Cardoso nip10

🎯
Focusing
View GitHub Profile
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
@pie6k
pie6k / package.json
Created January 28, 2020 05:24
Timpler package.json
{
"name": "Timpler",
"version": "0.0.1",
"private": true,
"scripts": {
"a": "cd ./android && ./gradlew app:assembleDebug && ./gradlew installDebug",
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@zero-master
zero-master / ClickLogConsumer.java
Created April 18, 2018 11:09
Write from Cloud Pub/Sub to BigQuery using Fileload and save cost on streaming inserts!
package ...
import com.google.api.services.bigquery.model.TableFieldSchema;
import com.google.api.services.bigquery.model.TableRow;
import com.google.api.services.bigquery.model.TableSchema;
import com.google.api.services.bigquery.model.TimePartitioning;
import com.google.common.collect.ImmutableList;
import org.apache.beam.sdk.Pipeline;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.io.gcp.bigquery.BigQueryIO;