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
for(var i = 1; i <= 100; i++){ | |
console.log(i%3 === 0 && i%5 === 0 && 'FizzBuzz' || i%3 === 0 && 'Fizz' || i%5 === 0 && 'Buzz' || i); | |
} |
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(){ | |
var TO_RUN = 20; | |
var sum = count = time = last = 0; | |
var first = false; // ignore the first time loop | |
var fn = function(){ | |
time = new Date().getTime(); | |
if(first === true){ | |
sum += time - last; |
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
git ls-tree --name-only -r HEAD | egrep -Z -E -a '\.(js|less|html|markdown|md|svg|sh|php)$' | xargs -n1 git blame -w -M -C --line-porcelain | grep "^author " | sort | uniq -c | sort -nr |
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
{"lastUpload":"2019-12-20T14:05:56.227Z","extensionVersion":"v3.4.3"} |
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
/** | |
* Simple implementation of LRU + SWR cache approaches to enable fast cache retrieval at the same time allowing refresh in the background | |
*/ | |
import LRUCache from 'lru-cache'; | |
const lruCache = new LRUCache<string, CacheFormat<any>>({ | |
max: 1000, | |
maxAge: Infinity, | |
// These two options are reduntant since we cache forever, but if we decide to change it |
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
/** | |
* This file is a tool to "grep" for code by using Abstract syntax trees | |
* It allows developers to do refactorings by searching for code patterns | |
* which would be hard to express using regular expressions | |
*/ | |
import { parse, ParserPlugin } from '@babel/parser'; | |
import traverse, { NodePath, TraverseOptions } from '@babel/traverse'; | |
import chalk from 'chalk'; | |
import fs from 'fs'; |
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
######################################################################## | |
# This gist is a fast way to get line contributions in git per author. # | |
# The results should not be intepreted seriously, line-contributions # | |
# are a weak indicator of the value of someone's contribution. # | |
######################################################################## | |
# If you have GNU parallel utility installed (recommended) | |
git ls-tree --name-only -r HEAD | parallel --eta "git blame -w -M -C --line-porcelain {} | grep \"^author \"" | sort -S 20G | uniq -c | sort -nr |
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
var observer; | |
if (observer) { | |
observer.disconnect(); | |
} | |
observer = new MutationObserver((mutationsList, observer) => { | |
mutationsList.forEach(mutation => { | |
if (mutation.addedNodes?.length > 0) { | |
mutation.addedNodes.forEach(highlightQaAttributes); |
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
// ------------------------------------------------------------------------------ | |
// Requirements | |
// ------------------------------------------------------------------------------ | |
const { isObject, some } = require("lodash"); | |
const utilsOriginal = require("eslint-plugin-vue/lib/utils"); | |
const casing = require("eslint-plugin-vue/lib/utils/casing"); | |
const cloneDeep = require("lodash/cloneDeep"); | |
const utils = cloneDeep(utilsOriginal); |
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
module.exports = { | |
"**/*.{ts?(x),vue}": () => "tsc", | |
"**/*.{ts?(x),vue,js?(x)}": "yarn lint", | |
"**/*.{vue,ts?(x),js?(x)}": () => "env CI=true yarn test:unit", | |
"{package.json,yarn.lock}": () => "yarn check --integrity" | |
}; |
OlderNewer