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
registry=https://artifactory.example.com/api/npm/proxy_of_npm/ | |
//artifactory.example.com/api/npm/proxy_of_npm/:_authToken=SUPER_SECRET_KEY | |
//artifactory.example.com/api/npm/proxy_of_npm/:always-auth=true | |
//artifactory.example.com/api/npm/YOUR_PERSONAL_REPOSITORY/:_authToken=SUPER_SECRET_KEY | |
//artifactory.example.com/api/npm/YOUR_PERSONAL_REPOSITORY/:always-auth=true |
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
'1234567890.123'.replace(/\d(?=(\d{3})+(?:$|\.))/g, '$& '); |
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
//+ Jonas Raoni Soares Silva | |
//@ http://raoni.org | |
// NOTES: | |
// 1. The vnode is provided by the directive callbacks | |
// 2. If eval sounds scary to you, you might replace it by any function that provides "navigation" from a string like "array[0].property" (that's what you get from the "expression") =] | |
getValue (vnode) { | |
//standard v-model | |
if (vnode.data.model) { |
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
//+ Jonas Raoni Soares Silva | |
//@ http://raoni.org | |
function tree(items) { | |
const tree = []; | |
const map = new Map; | |
for (const item of items) { | |
const placeholder = map.get(item.id); | |
item.children = placeholder ? placeholder.children : []; | |
map.set(item.id, item); |
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
/(["'`])(?:\\.|(?!\1).)*?\1/ |
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
//+ Jonas Raoni Soares Silva | |
//@ http://raoni.org | |
const signalR = require('@aspnet/signalR'); | |
export default class Hub { | |
constructor (url, autoReloadTimeout = 1000) { | |
Object.assign(this, { | |
url, | |
autoReloadTimeout, |
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
//+ Jonas Raoni Soares Silva | |
//@ http://raoni.org | |
export default class ServerTime { | |
constructor ({http = new Error('http parameter is required'), url = new Error('url is required'), thresholdDelay = 300, autoSynchronizeProbes = 0}) { | |
Object.assign(this, { | |
http, | |
url, | |
thresholdDelay, | |
best: null |
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
//+ Jonas Raoni Soares Silva | |
//@ http://raoni.org | |
export default function debounce (action, delay) { | |
let handle; | |
return function (...args) { | |
if (handle) { | |
clearTimeout(handle); | |
handle = null; | |
} |
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
//+ Jonas Raoni Soares Silva | |
//@ http://raoni.org | |
export default (...values) => Math.max(...values.map(value => | |
(value = (value + '').split(/[.,]/)).length > 1 && value.pop().length | |
)); |
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
Backup = { | |
shell: WScript.CreateObject("WScript.Shell"), | |
base: "C:/BACKUP/", | |
username: "USERNAME", | |
hostname: "HOST", | |
password: "PASSWORD", | |
type: { | |
postgreSQL: function(){ | |
var shell = Backup.shell; | |
var path = "c:/program files/postgresql/9.6/bin/"; |