Skip to content

Instantly share code, notes, and snippets.

View cra's full-sized avatar
🔥

igor cra

🔥
View GitHub Profile
@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):
"""
$ 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 ()
{
import copy
a = [1, 2, 3]
b = []
c_d = [15, 18, 20]
d_d = []
e_l = [4, 5, 6]
f_l = []
#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;
}
@cra
cra / DRUGS.ipynb
Last active September 12, 2016 14:32
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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')]
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'},
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}'
#!/usr/bin/env python2
from datetime import datetime as dt
import os
from dot3k import lcd
if __name__ == "__main__":
lcd.write(dt.now().strftime("%Y/%m/%d %H:%M"))
#!/bin/env python
from __future__ import annotations
import itertools
import pathlib
import operator
from typing import Dict, List, NamedTuple, Optional, Tuple, Union