Skip to content

Instantly share code, notes, and snippets.

View LekoArts's full-sized avatar
ars aurea

Lennart LekoArts

ars aurea
View GitHub Profile
@LekoArts
LekoArts / multiFilter.js
Created May 16, 2019 09:11 — forked from jherax/arrayFilterFactory.1.ts
Filters an array of objects with multiple criteria.
/**
* Filters an array of objects with multiple criteria.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria as the property names
* @return {Array}
*/
function multiFilter(array, filters) {
const filterKeys = Object.keys(filters);
// filters all elements passing the criteria
const spawn = require('cross-spawn')
/**
* GetLastUpdatedTimestamp - Get the last time a file was commited to GitHub and therefore was updated
* @param filepath
* @returns {number} - Date
*/
const getLastUpdatedTimestamp = filepath =>
parseInt(spawn.sync('git', ['log', '-1', '--format=%ct', filepath]).stdout.toString('utf-8'), 10) * 1000
@LekoArts
LekoArts / incomplete-config.js
Created January 24, 2020 11:06
Configs for Figma Theme UI plugin
module.exports = {
space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
fonts: {
body: '-apple-system, BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"',
heading: 'inherit',
monospace: 'Menlo, monospace',
},
fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 96],
lineHeights: {
body: 1.5,
@LekoArts
LekoArts / test01.mdx
Last active April 18, 2020 18:59
recipes test 01

Install @lekoarts/gatsby-theme-minimal-blog

Foobar


Add the theme to the gatsby-config.js

@LekoArts
LekoArts / Windows install
Last active September 1, 2022 05:49 — forked from wardpeet/Windows install
Using Scoop + Powershell to setup new Windows machine
# Disable executionpolicy
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
# install scoop
iwr -useb get.scoop.sh | iex
# setup applications
scoop bucket add github-gh https://github.com/cli/scoop-gh.git
scoop bucket add extras
@LekoArts
LekoArts / spacer.tsx
Created January 15, 2021 23:40
Chakra UI TypeScript "Spacer" component
import * as React from "react"
import { Box, BoxProps } from "@chakra-ui/react"
interface ISpacerProps extends BoxProps {
size: BoxProps["width"]
axis: "vertical" | "horizontal"
}
const Spacer = ({ size, axis, ...rest }: ISpacerProps) => {
const width = axis === `vertical` ? `1px` : size
@LekoArts
LekoArts / search-engines-blocklist.txt
Created January 11, 2022 15:51
Blocklist of annoying StackOverflow copycats in uBlock Origin
! Title: Search engine domains
! Description: Remove certain domains from Google/DuckDuckGo
! See also: https://github.com/darekkay/config-files/blob/master/adblocker/search-engines.txt
! See also: https://gist.github.com/quenhus/6bd2c47e5780f726f0c96c0a2ee762a4
! Google
! Low quality
google.*##.g:has(a[href*="geeksforgeeks.org"])
google.*##.g:has(a[href*="gutefrage.net"])