(() => {
let { offsetWidth, offsetHeight } = document.documentElement;
let walker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT);
while (walker.nextNode()) {
let bound = walker.currentNode.getBoundingClientRect();
let isWidthOverflow = bound.right > offsetWidth || bound.left < 0;
let isHeightOverflow = bound.bottom > offsetHeight || bound.top < 0;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Open notion in app | |
// @namespace https://gist.github.com/jeiea/514c8c0862710cc04aa9cbb5ac465c84 | |
// @downloadURL https://gist.github.com/jeiea/514c8c0862710cc04aa9cbb5ac465c84/raw/open_in_notion.user.js | |
// @version 0.3 | |
// @description Useful with slack integration. | |
// @author jeiea | |
// @match https://www.notion.so/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=notion.so | |
// @grant window.close |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !! | |
Dart Code extension: 3.34.0 | |
Flutter extension: 3.34.0 (activated) | |
App: Visual Studio Code | |
Version: 1.64.0 | |
Platform: win | |
Workspace type: Flutter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const makePageNavigator = ref => { | |
let currentPage; | |
let ratio; | |
let ignoreIntersection = false; | |
const resetAnchor = entries => { | |
const container = ref.current; | |
if (!container?.clientHeight || entries.length === 0) { | |
return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// deno run sql_format.ts | |
import { format } from "http://esm.sh/[email protected]"; | |
import { readAll, writeAll } from "https://deno.land/[email protected]/io/mod.ts"; | |
const input = await readAll(Deno.stdin); | |
const unformatted = new TextDecoder().decode(input); | |
const formatted = format(unformatted, { language: "mysql" }); | |
await writeAll(Deno.stdout, new TextEncoder().encode(formatted)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
const collapsedTrace = (message) => { | |
console.groupCollapsed(message); | |
console.trace(); | |
console.groupEnd(); | |
}; | |
const isPrimitive = (x) => x !== Object(x); | |
const proxy = (target, path) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You shouldn't execute this if you didn't read it. | |
# If not installed | |
brew install sd | |
# Not effective commands | |
find . -ipath '*apple*' -type f | tac > source.txt | |
cat source.txt | sd 'apple' 'banana' | sd 'Apple' 'Banana' > dest.txt | |
paste -d" " source.txt dest.txt > replace.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import { useKeenSlider } from 'keen-slider/react'; | |
import 'keen-slider/keen-slider.min.css'; | |
KeenSlider.propTypes = { | |
children: PropTypes.node, | |
}; | |
function KeenSlider({ children, ...props }) { | |
const [sliderRef] = useKeenSlider({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jq 'def r: walk(if type == "array" then if .[0] then [.[0]] else [] end else (fromjson? | r) // . end); r' a.json | |
# a.json | |
# { | |
# "array": [1,2,3], | |
# "nested_json": "{\"likes\": [1,2,3]}" | |
# } | |
# | |
# output | |
# { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "build", | |
"type": "shell", | |
"command": "chcp 65001; stack build --fast", | |
"group": { |