Skip to content

Instantly share code, notes, and snippets.

View peko's full-sized avatar

Vladimir Seregin peko

  • https://peko.github.io/about
  • Frankfurt
View GitHub Profile
@peko
peko / copy_files.sh
Last active January 31, 2024 15:41
Fastest rsync I ever know
#!/bin/bash
tar cf - * | mbuffer -m 1024M | ssh -i ~/.ssh/<key.pem> <destination_ip> '(cd /home/ubuntu/<destination_folder>; tar xf -)'
@peko
peko / triangle.md
Last active June 30, 2016 13:58
triangle encoding

triangle write

edges

9 bit

512 variants

@peko
peko / change.js
Last active July 13, 2016 10:58
change.js
function onEdit(e){
if(e) {
var range = e.range;
if(range.getA1Notation() == "A1") {
for(var i=2; i<=10; i++) {
SpreadsheetApp.getActiveSheet().getRange('A'+i).setValue(e.value);
Utilities.sleep(5000);
}
}
}
И я не умерла нет?
Когда ты здесь сам, я облетают...
Любимый камыши -
и эти я мне плыть,
Но дома в краю Канэми мог,
Точно цветущие клочок.
У заглохшего горы
@peko
peko / emoji_sentiments.coffee
Last active September 1, 2016 23:00
Emoji sentiments
###
Format:
codePoint:[negative, neutral, positive, sentiment]
Details: http://kt.ijs.si/data/Emoji_sentiment_ranking/
Correct access:
> "emoji".getCodePointAt(0)
@peko
peko / minimal-nn.py
Created September 4, 2016 17:10
Minimal neural network
import numpy as np
# sigmoid
def nonlin(x, deriv=False):
if deriv is True:
return x*(1-x)
return 1/(1+np.exp(-x))
# train data
X = np.array([
@peko
peko / stupid.json
Last active September 5, 2016 15:57
два слоя по 10 нейронов
{"layers":[{"out_depth":59,"out_sx":1,"out_sy":1,"layer_type":"input"},{"out_depth":10,"out_sx":1,"out_sy":1,"layer_type":"fc","num_inputs":59,"l1_decay_mul":0,"l2_decay_mul":1,"filters":[{"sx":1,"sy":1,"depth":59,"w":{"0":0.09185641674540913,"1":-0.23482697419212847,"2":0.03610922694885955,"3":-0.26089903272219805,"4":-0.1931942419841784,"5":-0.05849364037585666,"6":-0.1440385490458202,"7":-0.014679453900823378,"8":0.06884464567158986,"9":-0.0627546155847871,"10":0.144897715278581,"11":0.046716292175682,"12":-0.13465435759025793,"13":0.022758477666650172,"14":0.06379224081052678,"15":-0.06495774375788134,"16":0.11988495814337947,"17":-0.07151786118954499,"18":-0.01626746018599668,"19":-0.06593568495121686,"20":0.12065461991703072,"21":0.1328802602541985,"22":-0.2057277386399549,"23":0.05200859173284947,"24":0.17106603589710476,"25":0.021563250649868037,"26":0.0544781910530498,"27":-0.18025379515587403,"28":0.04179389323721859,"29":-0.0298147856376088,"30":0.1780439233486908,"31":0.17371355786332354,"32":-0.1
@peko
peko / LiveCoding Instructions
Created October 26, 2016 12:23 — forked from devx00/LiveCoding Instructions
Instructions to setup external streaming and chatting for livecoding.tv streams
// ************** Instructions for connecting to the LiveCoding chatrooms from a 3rd party application. ****************
Step 1a (Ubuntu/ any OS with aptitude (aka apt-get)) :
sudo apt-add-repository ppa:rsrchboy/profanity && sudo apt-get update
apt-get install profanity
--
Step 1b (OSX w/ homebrew):
$ brew install profanity
--------
@peko
peko / fast_writer.c
Created October 27, 2016 17:12
fast_writer | slow_reader
#include <stdio.h>
int main(int argc, char** argv) {
char buf[256];
for(int i = 0; i < 1000000; i++){
fprintf(stdout, "line %d\n", i);
fprintf(stderr, "[wr] line %d writed\n", i);
}
}
@peko
peko / trash-gmail.py
Created January 25, 2017 09:20
Trash gmail
#!usr/bin/python
import email, imaplib
user = 'xxx'
pwd = 'xxx'
m = imaplib.IMAP4_SSL("imap.gmail.com")
m.login(user,pwd)
m.select("some_gmail_label")