Skip to content

Instantly share code, notes, and snippets.

@yarko
yarko / index.html
Created September 16, 2017 18:47
JPNG.svg (Transparent PNG with JPEG Compression)
<header class="container">
<div class="logo">
<h1 class="logo__heading">
<img class="logo__image" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/39255/jpng-logo.png" alt="JPNG.svg" />
</h1>
<small class="logo__subtitle"><em>This logo was originally 300kb, but compressed down to 69kb using the tool below.</em></small>
</div>
@yarko
yarko / check_links.py
Last active December 30, 2017 21:40
quick check for valid links on a webpage
@yarko
yarko / bitops.py
Last active January 28, 2018 01:23
correct bit complement operation in python (it doesn't seem to work as expected - i.e. on unsigned value - or byte value)
# coding: utf-8
'''
Tried to bit-invert a CSS hex-encoded color using python, but
couldn't get expected output with bit-invert operator.
I.e. this didn't do what I expected:
print(f'#{old_color:x} => #{~old_color:x}')
Besides acting on an apparently arbitrary length integer (rather
than an unsigned (i.e. sign-not-interpreted) bit pattern, the operator
@yarko
yarko / config.sh
Last active December 8, 2021 18:14 — forked from leolord/vim.sh
Compiling vim on Ubuntu 18 with LUA-support
# my build: (Ubuntu 20.04)
# see notes (2/12/2020):
# https://github.com/ycm-core/YouCompleteMe/wiki/Building-Vim-from-source
# be sure we have libgtk-3-dev installed
# sudo apt install libgtk-3-dev
./configure \
--with-features=huge \
--enable-multibyte \
--enable-luainterp=yes \
--enable-python3interp=yes \
@yarko
yarko / separate_mbox.py
Created August 7, 2020 04:30
Start looking at large mbox / gmail file
#!/usr/bin/env python
'''
separate_mbox [input_mbox] [filter_label]
'''
from collections import Counter
from pprint import pprint
from sys import argv, stdin, stdout, stderr
# write based on first label