Skip to content

Instantly share code, notes, and snippets.

{"locale":"uk","category_tree":[{"id":666793,"label":"Роботи","listing_shapes":[{"id":293219,"label":"Потреба"},{"id":293220,"label":"Моя допомога"}],"subcategories":[{"id":666805,"label":"IT / Розробка / Зв'язок","listing_shapes":[{"id":293219,"label":"Потреба"},{"id":293220,"label":"Моя допомога"}],"subcategories":[]},{"id":666812,"label":"Тексти / Переклади","listing_shapes":[{"id":293219,"label":"Потреба"},{"id":293220,"label":"Моя допомога"}],"subcategories":[]},{"id":667542,"label":"Прості онлайн роботи","listing_shapes":[{"id":293219,"label":"Потреба"},{"id":293220,"label":"Моя допомога"}],"subcategories":[]},{"id":666807,"label":"Дизайн / Графіка","listing_shapes":[{"id":293219,"label":"Потреба"},{"id":293220,"label":"Моя допомога"}],"subcategories":[]},{"id":666820,"label":"Перевезення / Логістика / Склад","listing_shapes":[{"id":293219,"label":"Потреба"},{"id":293220,"label":"Моя допомога"}],"subcategories":[]},{"id":666813,"label":"Проста фізична робота / Спеціальності","listing_shapes":[{"id":2932
@EugeneLoy
EugeneLoy / bping_monitor.bat
Last active December 15, 2021 19:37
Monitor internet connection using bping
FOR /L %%N IN () DO (
timeout /t 60
bping -d -f=alarm.wav 4.2.2.4 -t=10 -n=1
)
youtube-dl -o "%(playlist_index)s-%(title)s.%(ext)s" -f 22 "url_here"
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2)
@EugeneLoy
EugeneLoy / performance
Last active February 7, 2018 21:38 — forked from jboner/latency.txt
Performance analysis numbers
Latency Comparison Numbers
--------------------------
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
@EugeneLoy
EugeneLoy / export.py
Created January 19, 2018 16:42
Export cards from specific list in Trello (json) to csv
import json
import csv
LIST_NAME = "Backlog"
INPUT_FILE = "data.json"
OUTPUT_FILE = 'data.csv'
with open(INPUT_FILE) as jsonfile:
data = json.load(jsonfile)
@EugeneLoy
EugeneLoy / .bashrc
Created August 22, 2017 10:37
git config
export PS1='\[\033[01;37m\]\u@\h\[\033[01;32m\] \w $(__git_ps1 "\n[%s]")
\$\[\033[00m\] '
@EugeneLoy
EugeneLoy / cheatsheets
Last active June 11, 2021 13:34
Cheat Sheets
Searching ---------------------------------------------------------------------
Find all files that has full filename pattern "YYY" in this rdirectory, recursive:
find . -wholename "YYY"
Find all matches of regexp "XXX" in file YYY:
grep -n -E "XXX" YYY
Find all occurences of "XXX" in all files with name "YYY" in this directory, recursive:
find . -name "YYY" -print0 | xargs -0 grep -n -F "XXX"
@EugeneLoy
EugeneLoy / main.scala
Created March 16, 2017 19:15
Silence Spark logging
import org.apache.log4j.Logger
import org.apache.log4j.Level
Logger.getLogger("org").setLevel(Level.ERROR)
Logger.getLogger("akka").setLevel(Level.ERROR)
@EugeneLoy
EugeneLoy / axline.py
Last active November 15, 2016 19:38
pyplot: draw a line through 1 or 2 reference points (works with scrolling)
import matplotlib.pyplot as plt
def axline(xdata, ydata, ax = plt.subplot(111), *args, **kwargs):
try:
x1 = xdata[0]
y1 = ydata[0]
except:
# assume first point coordinates given as numbers
x1 = float(xdata)