Skip to content

Instantly share code, notes, and snippets.

View yevhenorlov's full-sized avatar
🇺🇦

Yevhen Orlov yevhenorlov

🇺🇦
View GitHub Profile
@yevhenorlov
yevhenorlov / vim-global-search-and-replace.md
Last active May 14, 2018 08:53
project-wide search and replace in vim
  1. Set up search scope with :args command (populates vim's arguments list):
selects all .vue files recursively

:args **/*.vue
  1. (optional) View arguments list with :args, add/remove with :argadd and :argdelete respectively
@yevhenorlov
yevhenorlov / printSelectorList.js
Created July 25, 2018 08:46
Print component's classes (as CSS selectors) to a String and return it. Log to console optionally.
function printSelectorList(selector, logToConsole) {
const _logToConsole = !!logToConsole || false
if (!selector) throw new TypeError('Selector argument is required')
if (typeof selector !== 'string') {
throw new TypeError('Attribute must be a string')
}
const component = document.querySelector(selector)
const descendants = Array.prototype.slice.call(
component.querySelectorAll('*'),
0
max="$1"
date
echo "url: $2
rate: $max calls / second"
START=$(date +%s);
get () {
curl -s -v -k "$1" 2>&1 | tr '\r\n' '\\n' | awk -v date="$(date +'%r')" '{print $0"\n-----", date}' >> /tmp/perf-test.log
}
@yevhenorlov
yevhenorlov / zip-into-chunks.sh
Last active May 12, 2019 10:39
zip a large folder into multiple 3GB parts for easier transfer
# zip a large folder into multiple 3GB parts for easier transfer
zip -r -s 3g archive.zip FolderName/
@yevhenorlov
yevhenorlov / remove-node_modules-recursively.sh
Last active May 12, 2019 10:38
remove node_modules recursively starting from current folder
# remove node_modules recursively starting from current folder
find . -name "node_modules" -exec rm -rf '{}' +
@yevhenorlov
yevhenorlov / wget-series.sh
Created May 12, 2019 10:37
download series of files in order
# downloads files from 01 to 99
wget https://link-to-file/{01..99}
@yevhenorlov
yevhenorlov / getTitleUrlMap.js
Last active September 12, 2019 17:08
get a map of titles and thumbnail urls from a youtube playlist (up to 50 results)
const axios = require('axios')
async function getYoutubePlaylistSnippets({ APIKey, playlistId }) {
const playlistItemsUrl = 'https://www.googleapis.com/youtube/v3/playlistItems'
const {
data: { items }
} = await axios.get(playlistItemsUrl, {
params: { playlistId, part: 'snippet', maxResults: 50, key: APIKey }
})
return items
}
@yevhenorlov
yevhenorlov / perfect-circuit-scraper.js
Last active June 28, 2021 11:46
a simple node.js scraper for automatically checking item availability on perfectcircuit.com
const puppeteer = require("puppeteer");
const URLS = [
"https://www.perfectcircuit.com/intellijel-zeroscope-1u.html", // Zeroscope Oscilloscope 1U
"https://www.perfectcircuit.com/expert-sleepers-es-8.html", // ES-8 USB Audio Interface
"https://www.perfectcircuit.com/4ms-pingable-envelope-generator.html", // Pingable Envelope Generator
"https://www.perfectcircuit.com/make-noise-erbe-verb-dsp-reverb-module.html", // Erbe-Verb DSP Reverb
"https://www.perfectcircuit.com/xaoc-devices-batumi-model-1974.html", // Batumi Quad LFO
"https://www.perfectcircuit.com/intellijel-shifty.html", // Intellijel Shifty
"https://www.perfectcircuit.com/eowave-domino.html", // Eowave Domino Full Synth Voice
Here's Mark Tarver's essay "The Bipolar Lisp Programmer", backed up from
https://web.archive.org/web/20080709051856/http://www.lambdassociates.org/blog/bipolar.htm
---
Having programmed in or around Lisp for nearly 20 years now, and spectated a lot
of Usenet postings and blogs written by Lisp programmers, I have often wondered
if there was such a thing as a 'Lisp character', in the same way that groups and
nations have a national character. After some thought, I decided there was