Skip to content

Instantly share code, notes, and snippets.

View szkrd's full-sized avatar

szabolcs kurdi szkrd

  • tralfamadore
View GitHub Profile
@szkrd
szkrd / record-screen.sh
Created February 19, 2020 20:27
record window on x11 using ffmpeg
#!/usr/bin/env bash
NOCOLOR='\e[0m'
RED='\e[0;31m'
GREEN='\e[0;32m'
YELLOW='\e[1;33m'
CYAN='\e[0;36m'
command -v ffmpeg >/dev/null 2>&1 || { echo >&2 "${RED}ffmpeg not installed!${NOCOLOR}"; exit 1; }
echo -e "You can select a window for ${CYAN}fixed coordinates${NOCOLOR} in 3 seconds."
sleep 3
echo "Select window!"
@szkrd
szkrd / i18nForTests.js
Last active October 17, 2019 12:26
react-i18next detect missing keys during test
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import resources from '../locales/translations.json';
// we disable the translation texts for dev mode so that the
// tests would only break if an ID is missing but not
// if the translation has been changed by the translators.
const devTranslations = Object.keys(resources['en-US'].translation).reduce((acc, key) => {
acc[key] = key;
return acc;
@szkrd
szkrd / init-standard.sh
Created July 28, 2019 11:21
node standard seed (standard, eslint, prettier)
#!/usr/bin/env bash
# EDITORCONFIG
# ============
echo "\
root = true
[*]
indent_style = space
@szkrd
szkrd / bandcamp-pls.js
Last active July 30, 2019 11:09
save bandcamp album tracks to a pls playlist
// save bandcamp album tracks to a pls playlist;
// mp3 file urls are protected by a token, so these playlist
// will "expire", but at least one can use a native player;
// still, please do read http://bandcamp.com/help/audio_basics#steal
// and http://bandcamp.com/terms_of_use
//
// ```
// mkdir bandcamp-pls && \
// cd bandcamp-pls && \
// npm init --yes && \
@szkrd
szkrd / ikbcf87.md
Last active March 24, 2025 01:17
IKBC F87 Backlit Keyboard Instruction

IKBC F87 Backlit Keyboard Instruction

  1. Time countdown with one key
  2. Different backlighting modes
  3. TKL 87 ANSI layout
  4. Double shot backlit keycaps
  5. Integrated with three layouts (QWERTY, DVORAK, COLEMAK)

Time countdown key modes

@szkrd
szkrd / autoConnect.ts
Last active July 19, 2020 09:48
react redux typescript fancy connect (with IDE code completion)
import store, { IState } from '../../actions'
import { connect } from 'react-redux'
const isFunc = (item) => typeof item === 'function'
const isNotFunc = (item) => !isFunc(item)
const filter = (obj, comp) => {
return Object.keys(obj).reduce((acc, key) => {
if (comp(obj[key])) {
acc[key] = obj[key]
}
@szkrd
szkrd / prettifyChanged.js
Last active April 11, 2019 13:48
prettify changed ts(x) files
const fs = require('fs')
const path = require('path')
const shell = require('shelljs')
const prettier = require('prettier')
const args = process.argv
const doGitAdd = args.includes('--git-add') || args.includes('-ga')
const FILTER_PATTERN = /\.tsx?$/
shell.config.silent = true
const changedFiles = shell.exec('git status --porcelain=v1 -z')
@szkrd
szkrd / createBem.ts
Created August 30, 2018 08:30
quick bem helper hack
import * as log from 'loglevel'
// # create bem
//
// ```
// const bem = createBem('my-favorite-foods')
//
// bem.b() === 'my-favorite-foods'
// bem.b('ordered') === 'my-favorite-foods--ordered'
// bem.b(['ordered', 'waiting-for']) === 'my-favorite-foods--ordered my-favorite-foods--waiting-for'
@szkrd
szkrd / create_pcsettings_links.js
Last active August 11, 2018 18:06
Creates opener links for all the PC Settings in Windows 10, so a file indexer can pick them up without an effort.
!dpi should be 125.37, but thats just huge
!the rest has been taken from the arch forum
xft.dpi: 110
xft.antialias: true
xft.rgba: rgb
xft.hinting: true
xft.hintstyle: hintslight
!xterm settings, mostly taken from the arch wiki
xterm*reverseVideo: on