Skip to content

Instantly share code, notes, and snippets.

View cra's full-sized avatar
🔥

igor cra

🔥
View GitHub Profile
import requests
class Bot:
BASE_URL = 'https://api.telegram.org'
def __init__(self, token: str) -> None:
self.token = token
self.base_url = f'{self.BASE_URL}/bot{token}'
curators_dict = {
# andan
'a.fenin@letnyayashkola.org': {'workshop_slug': 'andan'},
'a.zhukova@letnyayasnkola.org': {'workshop_slug': 'andan'},
'm.servetnik@letnyayashkola.org': {'workshop_slug': 'andan'},
'e.rybina@letnyayashkola.org': {'workshop_slug': 'andan'},
'g.moroz@letnyayashkola.org': {'workshop_slug': 'andan'},
'e.kozhanova@letnyayashkola.org': {'workshop_slug': 'andan'},
# astrogeo
'k.vlasov@letnyayashkola.org': {'workshop_slug': 'astrogeo'},
to_parse = """
If (feature 1 <= 0.0690282131661442)
Predict: 0.0
Else (feature 1 > 0.0690282131661442)
Predict: 1.0
"""
def parse_this_shit(shit):
lines = [line.strip() for line in shit.split('\n')]
@cra
cra / DRUGS.ipynb
Last active September 12, 2016 14:32
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <iostream>
using namespace std;
void printArray(const int* const b, const unsigned size)
{
for (unsigned i = 0; i < size; i++)
cout<< b[i] << ' ';
cout << endl;
}
import copy
a = [1, 2, 3]
b = []
c_d = [15, 18, 20]
d_d = []
e_l = [4, 5, 6]
f_l = []
$ squeue -u andrey | awk '{print $1}' | grep -v 'JOBID' > /tmp/andrey_pending_jobs
for jid in ` squeue -u igomo | awk '{print $1}' | xargs grep -v 'JOBID' `
do
scontrol update Dependency=after:`cat /tmp/andrey_pending_jobs | tr '\n' ':' | sed 's/.$//'` JobId=${jid}
done
# .bashrc aliases
go2workdir ()
{
@cra
cra / utils.py
Created February 11, 2015 13:19
Agora members list generator. Uses .csv as input
#!/usr/bin/python2
# coding: utf-8
import csv
import codecs
import sys
class UTF8Recoder(object):
"""
@cra
cra / copy from yaourt output
Last active August 29, 2015 14:14
aur/modules compiling problem
==> Making package: modules 3.2.10-1 (Tue Feb 3 15:50:25 CET 2015)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Downloading modules-3.2.10.tar.bz2...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 383 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 461 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 375 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
@cra
cra / yoba.sh
Last active August 29, 2015 14:10
Bash stub. Autocopy file to the USB inserted
#!/bin/bash
INITIAL_MOUNTPOINT=/media/0000-0001
PATH_TO_FILE=/tmp/TAMD_2014_Abstract_book.pdf
INTERVAL=5
DEVICE=/dev/sdc1
NEW_LABEL=TAMD-2014
while true; do