Skip to content

Instantly share code, notes, and snippets.

View szkrd's full-sized avatar

szabolcs kurdi szkrd

  • tralfamadore
View GitHub Profile
@szkrd
szkrd / private.xml
Created September 16, 2016 08:40
Karabiner home (hungarian layout, two keyboards: logitech pc hu vs default air hu)
<?xml version="1.0"?>
<root>
<item>
<name>Hun2Hun q \</name>
<identifier>private.right_option_q_to_backslash</identifier>
<autogen>
__KeyToKey__
KeyCode::Q, ModifierFlag::OPTION_R,
KeyCode::MINUS, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_OPTION
</autogen>
@szkrd
szkrd / mod-rewrite-test.js
Created September 20, 2016 15:20
Testing webpack devserver rewrite rules is a pain in the back.
/*
{
"name": "mod-rewrite-test",
"version": "0.0.1",
"main": "index.js",
"scripts": { "dev": "nodemon .", "start": "node ." },
"dependencies": { "connect-modrewrite": "^0.9.0", "express": "^4.14.0" },
"devDependencies": { "nodemon": "^1.9.2" }
}
*/
@szkrd
szkrd / crude_json_prettify.js
Last active July 22, 2017 12:49
prettify json for spec console logs
// dumb
console.log('>>>\n' + JSON.stringify(instance.state, null, 2).replace(/ "([a-zA-Z_]*)": /g, ' $1: ').replace(/ "([^"]*)"(,?)/g, ' \'$1\'$2') + '\n<<<');
// dumber
console.log('>>>\n' + JSON.stringify(result, null, 2).replace(/"/g, '\'').replace(/(\s+)'([^']*)'(: )/g, '$1$2$3')) + '\n<<<')
// copy-paste to console
copy(JSON.stringify(temp1, null, 2).replace(/"/g, '\'').replace(/(\s+)'([^']*)'(: )/g, '$1$2$3')))
@szkrd
szkrd / keybindings.json
Last active September 14, 2019 10:30
vscode keybindings (windows keyboard)
// plugins `ext install Bookmarks`
// ---
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "shift+alt+down",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
@szkrd
szkrd / webstorm.md
Last active September 14, 2019 10:19
keyboard shortucts and assorted notes for webstorm

WebStorm shortcuts (Win/Linux)

Reassigned

  • settings... -- ctrl + comma
  • navigate file... -- ctrl + shift + o
  • next bookmark -- F3
  • previous bookmark -- shift + F3
  • toggle bookmark -- ctrl + F3
  • show bookmarks -- ctrl + alt + F3
@szkrd
szkrd / tasks_settings.txt
Created October 18, 2017 09:02
cmder tasks
{bash}
C:\Progra~1\Git\bin\sh.exe --login -i -new_console:d:C:\users\szkrd
{work-cold}
C:\Progra~1\Git\bin\sh.exe --login -i -new_console:t:"fe-wp" -new_console:d:P:\front-end
C:\Progra~1\Git\bin\sh.exe --login -i -new_console:t:"fe" -new_console:d:P:\front-end
C:\Progra~1\Git\bin\sh.exe --login -i -new_console:t:"aping" -new_console:d:P:\prepair\aping
C:\Progra~1\Git\bin\sh.exe --login -i -new_console:t:"sf-cache" -new_console:d:P:\prepair\api-get-cache
C:\Progra~1\Git\bin\sh.exe --login -i -new_console:t:"sf-label" -new_console:d:P:\prepair\sf-label-manager
C:\Progra~1\Git\bin\sh.exe --login -i -new_console:t:"pp" -new_console:d:P:\github\pied-piper

Access local dev site from phone in a platform agnostic way

We have the foo.dev url in our hosts file.

If you want to access your dev machine, you will have to add this hostname "somehow" to a hosts file (with the proper ip address): this is not possible on unrooted android or IOS.

To access your machine from your phone, you can do the following:

  1. connect both machines to the same network
@szkrd
szkrd / much-silence-reporter.js
Created March 28, 2018 12:21
Mocha silent reporter.
/* eslint no-console:0, no-proto:0 */
const Base = require('mocha/lib/reporters/base');
function Min (runner) {
Base.call(this, runner);
let failed = false;
runner.on('fail', () => {
failed = true;
});
runner.on('end', () => console.log(`Tests ${failed ? 'failed' : 'passed'}.\n`));
@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);
@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...)