This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
####################################################### | |
# UNIX TREE # | |
# Version: 2.3 # | |
# File: ~/apps/tree/tree.sh # | |
# By Dem Pilafian # | |
# # | |
# Displays Structure of Directory Hierarchy # | |
# ------------------------------------------------- # | |
# This tiny script uses "ls", "grep", and "sed" # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toJSON(node) { | |
node = node || this; | |
var obj = { | |
nodeType: node.nodeType | |
}; | |
if (node.tagName) { | |
obj.tagName = node.tagName.toLowerCase(); | |
} else | |
if (node.nodeName) { | |
obj.nodeName = node.nodeName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { mount } from '@vue/test-utils' | |
import RadialProgressBar from './RadialProgressBar.vue' | |
let wrapper: any | |
describe('ui/primitives/RadialProgressBar', () => { | |
beforeEach(() => { | |
wrapper = mount(RadialProgressBar, { | |
propsData: { | |
size: 18, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { mount } from '@vue/test-utils' | |
import Highlight from './Highlight.vue' | |
let wrapper: any | |
describe('ui/Highlight', () => { | |
beforeEach(() => { | |
wrapper = mount(Highlight, { | |
propsData: { | |
search: '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* See demo (https://jsfiddle.net/yarkov_aleksei/e4Lwoq1g/) | |
*/ | |
const braces = [['{', '}'], ['[', ']'], ['(', ')'], ['<', '>']] | |
const strBraces = braces.map(b => b.join('')).join('') | |
function isOpen(char) { | |
for (let i = 0; i < braces.length; i++) { | |
if (braces[i][0] === char) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@include keyframe(fadeout) { | |
0% { | |
opacity: 1; | |
} | |
100% { | |
opacity: 0; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socketIo = require('socket.io-client') | |
const client = socketIo.connect('http://localhost:8080') | |
setInterval(() => { | |
client.emit('custom_stream', Buffer.from('aaaa')) | |
}, 1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function logClass(target: any) { | |
// save a reference to the original constructor | |
var original = target; | |
// a utility function to generate instances of a class | |
function construct(constructor, args) { | |
var c : any = function () { | |
return constructor.apply(this, args); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseJwt (token) { | |
const base64Url = token.split('.')[1] | |
const base64 = base64Url.replace('-', '+').replace('_', '/') | |
return JSON.parse(window.atob(base64)) | |
} | |
const token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVhNGQxMWExNjQ0ZWZmMDAwMTI0ZjA1ZiIsImlhdCI6MTUyMzYzNTgyOSwiZXhwIjoxNTIzNzIyMjI5fQ.Vhfcry3B9fqP1MmZ9Sz_VZK8FfVOwQ72MoGyvR0idNU' | |
console.clear() | |
console.log(parseJwt(token)) |