Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am krzystof on github.
  • I am c18y (https://keybase.io/c18y) on keybase.
  • I have a public key ASDnyxi3BqRx0GaZrtwgcoLNWH72RBoA_9DwFIhsh4hg-Ao

To claim this, I am signing this object:

@krzystof
krzystof / flatten.js
Last active July 5, 2018 18:05
Flatten an array
const nestedArray = [[1,2,[3]],4]
const flattened = flatten(nestedArray)
const expected = [1, 2, 3, 4]
/**
* Because I didn't want to pull in a test framework
* for this case, I am just writing a custom assertion
* to verify that the array is flattened as expected.
@krzystof
krzystof / shell_utils.sh
Created May 25, 2017 11:02
A stolen shell utils script stolen from
#!/bin/bash
##############################################################################
# #
# I just stole it from here https://natelandau.com/bash-scripting-utilities/ #
# #
##############################################################################
#
# Set Colors
import test from 'ava'
import sinon from 'sinon'
import Vue from 'vue/dist/vue.js'
import axios from 'axios'
// Helpers to simulate user interaction (fires event, click buttons, ...)
import interactWith from './helpers/browser'
let noteForm = {
$grey50: #FAFAFA
$grey100: #F5F5F5
$grey200: #EEEEEE
$grey300: #E0E0E0
$grey400: #BDBDBD
$grey500: #9E9E9E
$grey600: #757575
$grey700: #616161
$grey800: #424242
$grey900: #212121
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _sortablejs = require('sortablejs');
import Sortable from 'sortablejs';
export default {
bind() {
var self = this;
Sortable.create(this.el, {
animation: 150,
dataIdAttr: 'data-id',
@krzystof
krzystof / SelectTwo.vue
Last active November 10, 2015 14:25
SelectTwo vue component
<style>
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height: 34px;
}
</style>
<template>
<select :class="classes" :multiple="multiselect">
<option value="" v-if="! multiselect"></option>
</select>