Skip to content

Instantly share code, notes, and snippets.

View virtyaluk's full-sized avatar
🐱
:)

Bohdan Shtepan virtyaluk

🐱
:)
View GitHub Profile
@virtyaluk
virtyaluk / pseudosemver-sort.js
Last active June 24, 2016 21:42
pseudo-semver sort function
module.export = function(v1, v2) {
const sv1 = v1.split('.').map(Number),
sv2 = v2.split('.').map(Number),
res = [];
let sv1v = null,
sv2v = null;
for (let i = 0; i < Math.max(sv1.length, sv2.length); i++) {
sv1v = sv1[i] || 0;
sv2v = sv2[i] || 0;
@virtyaluk
virtyaluk / gist:14e54de4d48491faf841d508dddc8c1b
Created November 22, 2016 14:03 — forked from jasonrudolph/gist:6057563
GitHub Search API: Get the number of stars for a repository

James Sugrue [asked][1], "@GitHubAPI is there a way to find the number of stars for a given repository?"

Example

$ curl -ni "https://api.github.com/search/repositories?q=more+useful+keyboard" -H 'Accept: application/vnd.github.preview'
{
@virtyaluk
virtyaluk / install.sh
Last active September 12, 2021 17:52
Getting your Raspberry Pi/Asus TinkerBoard up and running: installing essential apt packages, Golang, Node.js, Docker.
sudo su
# In case of TinkerBoard, use the `tinker-config` alternative to the rpi's raspi-config
wget https://raw.githubusercontent.com/mikerr/tinker-config/master/tinker-config
# Enable multiverse repository
sed -i "/^# deb.*multiverse/ s/^# //" /etc/apt/sources.list
apt-get update
apt-get upgrade -y

Keybase proof

I hereby claim:

  • I am virtyaluk on github.
  • I am virtyaluk (https://keybase.io/virtyaluk) on keybase.
  • I have a public key ASBmPn79Gh3HeYGY8qjOh1QTmBNTeof6rQsYrPA_Pp_yoAo

To claim this, I am signing this object:

@virtyaluk
virtyaluk / Makefile
Created September 23, 2020 21:48 — forked from ecnerwala/Makefile
Competitive Programming Makefile
# +--------------------+
# | |
# | GENERAL CONFIG |
# | |
# +--------------------+
PROBLEM_NAME := problem_name
DEBUG := true
LANG := cpp
@virtyaluk
virtyaluk / latency.txt
Created March 6, 2022 23:13 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@virtyaluk
virtyaluk / convert.md
Created April 19, 2023 18:07 — forked from maximebories/convert.md
FFmpeg command to convert webm to mp4 video files
ffmpeg -i input.webm -c:v libx264 -preset slow -crf 22 -c:a aac -b:a 128k output.mp4

This ffmpeg command converts a .webm video file to a standard .mp4 file using the libx264 codec for video, aac codec for audio, and a CRF value of 22. The preset is set to 'slow' for higher quality encoding, and the audio bitrate is set to 128 kbps.

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.