strlen KEY
- if this works, it is a stringhlen KEY
- if this works, it is a hashllen KEY
- if this works, it is a listscard KEY
- if this works, it is a setzcard KEY
- if this works, it is a sorted-set
This file contains 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 Notion RTL | |
// @namespace https://rtl.notion.so/ | |
// @version 1.02 | |
// @description RTL support for Notion web application | |
// @author Nir Elbaz | |
// @match https://www.notion.so/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=notion.so | |
// @grant none | |
// ==/UserScript== |
This file contains 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
# Use an official Node.js runtime as the base image | |
FROM node:14 | |
# Set environment variables | |
ENV NODE_ENV=production | |
ENV PORT=3000 | |
# Create a work directory for the application | |
WORKDIR /app |
This file contains 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
FILE=$1 | |
BASENAME=`basename $FILE .csv` | |
ROWS=$2 | |
echo Splitting $FILE into multiple files of $ROWS rows each... | |
# split to chunks: | |
split -l $ROWS -d $FILE $BASENAME\_ | |
# append file extension: | |
for file in $(find $BASENAME\_*); | |
do mv $file $file.csv; |
This file contains 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
[ | |
{ | |
"selector": ":not(.nH[role=main], .nH[role=main] *)", | |
"description": "Gmail's all elements, except emails list / email message", | |
"matches": ["*://*.google.com/mail/u/*/#inbox", "*://*.google.com/mail/u/*/#inbox/*"] | |
} | |
] |
This file contains 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
/** | |
* Example of an async function which returns some value | |
*/ | |
function doSomething() { | |
return new Promise((resolve, reject) => { | |
window.setTimeout(function () { | |
resolve(Math.random() > 0.8); | |
}, 1000); | |
}); | |
} |
This file contains 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
# npm-deps-scanner | |
# Scans all projects in a directory and generates a global npm & bower dependencies list. | |
# dependencies: jq, npm, json2csv | |
# extract all dependencies: | |
find ./*/{package,bower}.json | xargs cat | jq '(.dependencies + .devDependencies) | keys[]' | sort | uniq | tr -d '"' > npm-deps-scan-pname.txt | |
# fetch each package info and write to file: | |
echo "[" > npm-deps-scan-pinfo.json | |
while read f; do |
This file contains 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 arr = [1, 2, 2, 8, 5, 5, 3, 8, 3]; | |
arr.sort().reduce((a, c) => { | |
if (a.includes(c)) { | |
return a; | |
} | |
a.push(c); | |
return a; | |
}, []); |
This file contains 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
/** | |
* @property {object} object - The object to query | |
* @property {string} path - The path of the property to get | |
* @property {object} fallback - The default value to return if no value found in path | |
* @returns {*} Returns the resolved value (undefined / fallback value / value found). | |
*/ | |
function get(object, path, fallback) { | |
const dot = path.indexOf('.'); | |
if (object === undefined) { |
This file contains 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
let a = [1, 2, 3, 4, 5, 6]; | |
let b = [1, 2, 3, 4, 5, 6]; | |
console.log('-- SLICE --'); | |
console.log('- Returns values which were removed'); | |
console.log('- Does not change the original array'); | |
console.log(a.slice(0, 2)); | |
console.log(a); | |
console.log(); |
NewerOlder