Skip to content

Instantly share code, notes, and snippets.

View drugoi's full-sized avatar
🏠
Working from home

Nikita Bayev drugoi

🏠
Working from home
  • Bereke Bank
  • Almaty, Kazakhstan
View GitHub Profile
@musatov
musatov / monoRepoTotalCoverage.js
Created May 20, 2023 14:47
This script automates code coverage reports in a monorepo setup using Jest and Turborepo. It collects and merges data from each package, providing a holistic view of code quality. Assumes a setup with each package outputting coverage data in a 'coverage' folder.
const fs = require('fs')
const path = require('path')
// Params
const pathToPreviousReport = process.argv[2]
// Functions
/**
* Reads the coverage-summary.{XXX}.json file and returns the parsed JSON object
* @param {*} pathToReport
* @returns
@bartvanandel
bartvanandel / yarn-sync.js
Last active November 15, 2022 22:41
Sync versions from yarn.lock back into package.json
const fs = require("fs");
/**
* Removes matching outer quotes from a string.
*
* @param {string} text - String to unquote
* @returns {string} - Unquoted string
*/
const unquote = text => /(["'])?(.*)\1/.exec(text)[2];
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active July 3, 2024 17:43
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@josephbriggsmrf
josephbriggsmrf / mrf-atenea.sh
Created November 15, 2016 10:11
Shell Script to automatically generate confluence page WIP
#!/bin/bash
# MRF-Atenea script to make automatic slides.
echo -n Username:
read username
echo -n Password:
read -s password
curl -u $username:$password -X POST -H 'Content-Type: application/json' -d '{
"type":"page",
@ezimuel
ezimuel / sign.sh
Created March 14, 2016 15:50
Sign and verify a file using OpenSSL command line tool. It exports the digital signature in Base64 format.
#!/bin/bash
# Sign a file with a private key using OpenSSL
# Encode the signature in Base64 format
#
# Usage: sign <file> <private_key>
#
# NOTE: to generate a public/private key use the following commands:
#
# openssl genrsa -aes128 -passout pass:<passphrase> -out private.pem 2048
# openssl rsa -in private.pem -passin pass:<passphrase> -pubout -out public.pem
@MoOx
MoOx / isDblTouchTap.js
Last active April 30, 2023 19:28
Double touch tap workaround for React based on onTouchTap (react-tap-event-plugin)
const dblTouchTapMaxDelay = 300
let latestTouchTap = {
time: 0,
target: null,
}
export default function isDblTouchTap(event) {
const touchTap = {
time: new Date().getTime(),
target: event.currentTarget,
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@chrisbolin
chrisbolin / serve.py
Last active March 22, 2023 13:53
Python SimpleHTTPServer for Static Serving (React / Angular / Ember) in HTML5 mode (a la mod_rewrite)
'''
Taken from:
http://stackoverflow.com/users/1074592/fakerainbrigand
http://stackoverflow.com/questions/15401815/python-simplehttpserver
'''
import SimpleHTTPServer, SocketServer
import urlparse, os
PORT = 3000
@nikcorg
nikcorg / berlin-jsconf-2014.md
Last active August 4, 2023 12:45
Slide decks of JSConf 2014
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.