Skip to content

Instantly share code, notes, and snippets.

Dmitry Myadzelets DmitryMyadzelets

Block or report user

Report or block DmitryMyadzelets

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@DmitryMyadzelets
DmitryMyadzelets / wlan0.md
Created Sep 12, 2019
How to get back wlan0 name in Debian
@DmitryMyadzelets
DmitryMyadzelets / grab-audio.md
Last active May 14, 2019
Record audio stream in Linux
View grab-audio.md

Record the current audio stream, and convert to mp3.

parec -d 0 | lame -r -V0 - out.mp3

Split the file based on silence in it. Source.

sox -V3 in.mp3 out_.mp3 silence -l 1 0.5 0.1% 1 2.0 0.1% : newfile : restart
View index.html
<link href='http://fonts.googleapis.com/css?family=Open+Sans:700' rel='stylesheet' type='text/css'>
<a id="view-code" href="http://codepen.io/virgilpana/pen/wBOBYo" target="_blank">VIEW CODE</a>
<div id="window">
<div id="header">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
@DmitryMyadzelets
DmitryMyadzelets / keyboard-layouts-40.md
Last active Jan 10, 2019
Keybord layouts collection
View keyboard-layouts-40.md

Layouts for 40% keyboards

View index.js
const factorial = (n) => n ? n * factorial(n - 1) : 1
// Given n, choose k - [Combination](https://en.wikipedia.org/wiki/Combination)
const C = (n, k) => factorial(n) / (factorial(k) * factorial(n-k))
View speedtests.md
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -

Example output:

Retrieving speedtest.net configuration...
Testing from WIND (151.48.54.99)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
@DmitryMyadzelets
DmitryMyadzelets / raspi-monitor
Created Jun 28, 2017 — forked from simlun/raspi-monitor
Script to enable and disable the HDMI signal of the Raspberry PI
View raspi-monitor
#!/bin/bash -e
# /usr/local/sbin/raspi-monitor
# Script to enable and disable the HDMI signal of the Raspberry PI
# Inspiration: http://www.raspberrypi.org/forums/viewtopic.php?t=16472&p=176258
CMD="$1"
function on {
/opt/vc/bin/tvservice --preferred
@DmitryMyadzelets
DmitryMyadzelets / ready.js
Created May 30, 2017
When a web page is ready for manipulation. Altrernative for jQuery ready()
View ready.js
// Invokes callback when DOM is ready for manipulation
// Usage: ready(function () {});
function ready(callback) {
// Motivation:
// https://gomakethings.com/a-native-javascript-equivalent-of-jquerys-ready-method/
// Docs:
// https://developer.mozilla.org/en/docs/Web/API/Document/readyState
var loading, done;
View it.zodiac.json
{
"capricorn":"Capricorno",
"aquarius":"Acquario",
"pisces":"Pesci",
"aries":"Ariete",
"taurus":"Toro",
"gemini":"Gemelli",
"cancer":"Cancro",
"leo":"Leone",
"virgo":"Vergine",
You can’t perform that action at this time.