This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Title</title> | |
</head> | |
<body> | |
<div style="display: inline-block"> | |
<h3 id="sequence"></h3> | |
<button id="start">Start</button> |
This file contains hidden or 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
// Colors reference | |
// You can use the following as so: | |
// console.log(colorCode, data); | |
// console.log(`${colorCode}some colorful text string${resetCode} rest of string in normal color`); | |
// | |
// ... and so on. | |
export const reset = "\x1b[0m" | |
export const bright = "\x1b[1m" | |
export const dim = "\x1b[2m" |
This file contains hidden or 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
const fs = require('fs'); | |
const path = require('path'); | |
const readDir = require('./readDir'); | |
function grepKeys(sourceDir = '', outDir = '') { | |
const re = /(\$t\(['"]|\$t\(\\['"]|\$t\(\\\\['"])(.*?)(['"]|\\['"]|\\\\['"])/g; | |
const include = ['.vue', '.ts', 'json', '.js']; | |
const exclude = ['.Stories.ts', '.stories.ts', '.spec.ts']; |
This file contains hidden or 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
find . -name node_modules -exec rm -rf {} \; | |
git branch | grep -v "develop" | grep -v "master" | xargs git branch -D | |
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*} |
This file contains hidden or 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
const punctuation = /^[~`!@#$%^&*(){}\[\];:"'<,.>?\/\\|_+=-]*$/g; | |
const letters = /^[^0-9~`!@#$%^&*(){}\[\];:"'<,.>?\/\\|_+=-]*$/g; | |
const usernamr = /^(?=.{8,20}$)(?![_.])(?!.*[_.]{2})[a-zA-Z0-9._]+(?<![_.])$/; | |
const replaceFirstTwoAndLastFour = (str, symbol) => { | |
const re = /^(.{2})|(.{4})$/g | |
return str.replace(re, replacer) | |
function replacer(match) { | |
return symbol.repeat(match.length) |
This file contains hidden or 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
export function debounce(func, ms = 0) { | |
let timer = null | |
return function(...args) { | |
if (timer) { | |
clearTimeout(timer) | |
} | |
timer = setTimeout(() => { | |
func.apply(this, args) |
This file contains hidden or 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 React from 'react' | |
import { connect } from 'react-redux' | |
export default (Component) => { | |
class WithConfig extends React.Component { | |
render() { | |
return <Component { ...this.props } /> | |
} | |
} |
This file contains hidden or 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
const searchIn = (string, haystack) => { | |
const result = [] | |
const matches = [] | |
const values = string.replace(/[^\wа-яё\s]/gi, '') | |
haystack.forEach((item) => { | |
let matchesCount = 0 | |
values.split(' ').forEach((needle) => { | |
if (needle && item.tags.toLowerCase().includes(needle.toLowerCase())) { |
This file contains hidden or 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 | |
# chmod +x .git/hooks/pre-commit | |
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") | |
if [[ "$STAGED_FILES" = "" ]]; then | |
exit 0 | |
fi | |
PASS=true |
This file contains hidden or 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 merge-base HEAD BRANCH_YOU_BRANCHED_FROM (HEAD -> dev, master... ) | |
git reset --soft COMMIT_HASH | |
git commit -am 'This is the new re-created one commit' | |
git push -f |
NewerOlder