Skip to content

Instantly share code, notes, and snippets.

View szkrd's full-sized avatar

szabolcs kurdi szkrd

  • tralfamadore
View GitHub Profile
@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 January 1, 2020 16:33
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
@szkrd
szkrd / fe.md
Created April 11, 2018 06:31
Frontend hiring step zero

Hi! We are looking for frontend developers and I would like to know more about your technical background. Please fork this gist or send it to me (or to your contact person), in whatever format you find comfortable.

This is not a test, there are no good answers or bad ones, it's just about setting up a context should we want to have a talk with each other. Thank you.

Now that we're through formalities, I'd like to know which of these technologies are familiar to you (meaning you used one in a project, tutorial, read lots of articles about it or just fairly sure you can get up to speed with it in a reasonable time etc).

Server side contexts

  • java (jsp, jsf...)
  • php (raw php, smarty, twig...)
@szkrd
szkrd / lint-pending.js
Created March 29, 2018 08:55
Lint modified files (but not yet committed) files.
require('colors');
const shell = require('shelljs');
const MAX_FILES = 30;
let lintCmd = 'node ./node_modules/eslint/bin/eslint';
let scssCmd = 'node ./node_modules/stylelint/bin/stylelint';
let status = shell.exec('git status --porcelain', { silent: true }).stdout;
let log = s => console.log(`• ${s}`.cyan);