Skip to content

Instantly share code, notes, and snippets.

@not7cd
not7cd / keybase.md
Last active October 28, 2017 10:36
Keybase

Keybase proof

I hereby claim:

  • I am not7cd on github.
  • I am not7cd (https://keybase.io/not7cd) on keybase.
  • I have a public key whose fingerprint is 75DE 3E75 8EBE CB90 B6E7 EE6A 8D7D AE55 FF05 5D98

To claim this, I am signing this object:

@not7cd
not7cd / translate_xml.py
Created July 26, 2017 19:26
Translate elements in XML and add proper "lang" attribute
from lxml import etree
import mtranslate
import copy
def copy_element(element):
"""Copies element usin deepcopy, returns it"""
result = copy.deepcopy(element)
return result
@not7cd
not7cd / determinant_10x10.ipynb
Last active August 31, 2017 20:10
Naive recursive matrix determinant
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@not7cd
not7cd / elementary_cellular_automaton.rs
Last active September 5, 2017 19:43
All possible elementary cellular automatons
const WIDTH: usize = 60;
fn get_bit(byte: u8, pos: u8) -> u8 {
return (byte >> pos) & 1;
}
fn print_row(row: [u8; WIDTH]) {
for x in row.iter() {
match x {
&0 => print!(" "),
from icalendar import Calendar, Event
file_path = 'fizyka_techniczna.ics'
g = open(file_path,'rb')
cal = Calendar.from_ical(g.read())
for component in cal.walk():
if component.name == "VEVENT":
component['uid'] = '%s%s' % (component['uid'], component['dtstart'])
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
char str1[] = "All work and no play makes Jack a dull boy";
char str2[] = "All work and no play\0 makes Jack a dull boy";
char str3[] = "All work";
@not7cd
not7cd / optivum_scraper.py
Last active March 10, 2018 09:28
Scrape timetable from HTML generated by Optivum by Vulcan
import os
import json
import requests
import dateutil.parser as dparser
from urllib.parse import urlparse
from bs4 import BeautifulSoup as bs
def get_soup(url):
response = requests.get(url)
@not7cd
not7cd / lab1.c
Created February 28, 2018 15:40
Proceduralne Języki Programowania I
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a, b, c, d, sum;
float avr;
printf("Give first number: ");
scanf("%i", &a);
printf("Give second number: ");
@not7cd
not7cd / lab.2.2.c
Last active March 7, 2018 15:34
Laboratorium 2 Proceduralne Języki Programowania I
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
char my_uni[80];
char pg[] = "politechnika";
char ug[] = "uniwersytet";
@not7cd
not7cd / lab3-1.c
Last active March 14, 2018 15:23
Laboratorium 3
#include <stdio.h>
int main()
{
float cel, fah;
float low_b = 0., up_b = 300., step = 20.;
printf("Provide lower bound:");
scanf("%f", &low_b);