Skip to content

Instantly share code, notes, and snippets.

@arturparkhisenko
arturparkhisenko / video.sh
Last active February 3, 2019 02:32
Video.sh
# This redirects the ffprobe help to a file
ffprobe -h > ffprobe_help.txt
# This creates a report next to your file
ffprobe -report SOMEFILE.mp4
# This creates your report as .json file next to your file
ffprobe -v quiet -print_format json -show_format -show_streams SOMEFILE.mp4 > ffprobe.json
@arturparkhisenko
arturparkhisenko / js-enum.js
Created January 26, 2019 01:23
js-enum.js
// https://twitter.com/rauschma/status/1088778137452924929
// TypeScript
enum Response {
No,
Yes
}
// JavaScript
const Response = Object.freeze({
@arturparkhisenko
arturparkhisenko / no-animations.css
Created January 12, 2019 02:16
pause js animations and disable css animations
/* https://dev.webonomic.nl/how-to-disable-css-transforms-transistions-and-animations */
*, :before, :after {
/*CSS transitions*/
transition-property: none !important;
/*CSS transforms*/
transform: none !important;
/*CSS animations*/
animation: none !important;
}
@arturparkhisenko
arturparkhisenko / full-width.css
Created November 10, 2018 01:47
full-width-css
/*
https://twitter.com/Una/status/951519740840873984
"Break out" of a parent's containing width to take the full screen of a page w/this nice utility class:
*/
.full-width {
width: 100vw;
position: relative;
left: 50%;
right: 50%;
@arturparkhisenko
arturparkhisenko / random-color.js
Created September 26, 2018 02:59
random-color.js
// https://twitter.com/jaffathecake/status/1038030104566358016?s=12
const hexColor = '#' +
Math.floor(Math.random() * 0x1000000)
.toString(16)
.padStart(6, '0');
@arturparkhisenko
arturparkhisenko / mediaevents-listener.js
Last active February 24, 2021 16:58
mediaevents listener
// https://html.spec.whatwg.org/multipage/media.html#mediaevents
const events = [
'loadstart',
'progress',
'suspend',
'abort',
'error',
'emptied',
'stalled',
'loadedmetadata',
# to start, you could repeat it up to x-cores/threads for example
yes > /dev/null &
# to stop
killall yes
@arturparkhisenko
arturparkhisenko / v8-bytecode.js
Last active February 8, 2018 19:07
Understanding V8’s Bytecode
// https://medium.com/dailyjs/understanding-v8s-bytecode-317d46c94775
// node --print-bytecode --print-bytecode-filter=ZXC v8-bytecode.js
function ZXC() {
var A = 0;
let B = 0;
const C = 0;
const O = {};
const N = 9;
@arturparkhisenko
arturparkhisenko / css-grid.css
Last active December 20, 2017 22:39
css-grid.css
/* -------------------------------------------------- */
/* https://twitter.com/wesbos/status/928731575684091904/photo/1 */
.wrapper {
display: grid;
grid-template-columns: repeat(12, 1fr);
grid-gap: 10px;
}
.sidebar {
@arturparkhisenko
arturparkhisenko / js-fun.js
Last active January 11, 2021 16:47
js fun
// https://twitter.com/MylesBorins/status/929414418680643585?s=09
const context = new window.AudioContext();
for (let i = 0; i < 10; i++) {
let osc = context.createOscillator();
osc.type = 'square';
osc.frequency.value = 40 + i * 0.1111;
osc.connect(context.destination);
osc.start();
}
// second part