Skip to content

Instantly share code, notes, and snippets.

@newtover
newtover / evol1234.tsv
Created June 12, 2022 23:19
evolution
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
1 3 панцирь
2 4 рога
3 1 норное
4 1 хищник
5 6 падальщик
6 7 интеллект
7 4 сотрудничество
8 3 падальщик
9 3 прожорливость
10 4 прожорливость
@newtover
newtover / distrib_from_freqs.py
Last active October 9, 2019 16:35
Percentiles from frequency distribution
import numpy as np
import scipy.stats
# some mapping from a value to the frequency
freqs = np.array([
[1, 3],
[2, 10],
[3, 13],
[4, 12],
[5, 9],
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
# https://www.vagrantup.com/docs/networking/forwarded_ports.html
# it's useful to have a predictable port pattern for different vagrant instances (here 10000 + n)
config.vm.network "forwarded_port", guest: 5000, host: 10080, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 22, host: 10022, id: "ssh"
vagrant@vagrant:~/tmp$ cat file1.txt
qwe
asd
zxc

vagrant@vagrant:~/tmp$ cat file2.txt
wer
sdf
xcv
@newtover
newtover / backToGifs.js
Last active July 26, 2021 18:12
unreadAfterForLepra.js
void function(){
var toImg = function(e1){
var img = document.createElement('img');
img.setAttribute('src', e1.dataset.orig);
e1.parentNode.replaceChild(img, e1);
};
var videos = document.querySelectorAll('video[data-orig]');
for (var i = videos.length - 1; i >= 0; i--){