This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import re | |
import pyduo | |
give = 15 | |
mock = False | |
duo = pyduo.Duolingo() | |
duo.login("username", "password") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "json" | |
require "mechanize" | |
def results | |
agent = Mechanize.new | |
credentials = { | |
pesel: ENV['PESEL'], | |
password: ENV['CKE_PASSWORD'] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
MR & JP | |
ver. 1.3.0 | |
16:15 14.01.2017 (w razie jakby coś się zmieniło jeszcze) | |
*/ | |
#ifndef IPCCHAT_IPCCHAT_H | |
#define IPCCHAT_IPCCHAT_H | |
// maksymalna liczba użytkowników |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(album) { | |
var intvl = setInterval(function() { | |
fetch('Metody_probabilistyczne_-__wiczenia_2016_17.html').then(x => x.text()).then(function(data) { | |
var dom = new DOMParser().parseFromString(data, "text/html"); | |
document.body.innerHTML = dom.getElementsByTagName('body')[0].innerHTML; | |
var tr = [].slice.call(dom.querySelectorAll('tr')).filter(tr => tr.firstChild.innerHTML == album)[0].lastChild.innerHTML; | |
if (tr != ' ') { | |
clearInterval(intvl); | |
alert(tr); | |
} else console.log('jeszcze nie ma'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'set' | |
def ohm(value, decimals=2) | |
value.round(decimals).to_s.sub('.', ',').sub(/,0+$/, '') << " \\Omega" | |
end | |
def frac(num, den) | |
"\\frac{#{num}}{#{den}}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#-*- coding: utf-8 -*- | |
""" | |
Gra w makao | |
Mikołaj Rozwadowski, 2014 | |
Zasady: | |
- karty dokładamy tak, żeby zgadzały się kolorem lub figurą | |
- jeśli na ręce nie ma pasujących kart, bierzemy jedną z talii | |
- karty o tych samych figurach można kłaść w jednym ruchu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "matrix" | |
require "readline" | |
class Rational | |
# convert to integer if is actually an integer | |
def try_to_i | |
to_i == self ? to_i : self | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "matrix" | |
class Variable | |
attr_accessor :name | |
def initialize(name) | |
@name = name | |
end | |
def to_s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple recursive function that checks the format of a data structure, | |
# which can consist of dicts, lists, tuples and primitive types. | |
def check_format(struct, obj): | |
if isinstance(struct, dict): | |
return isinstance(obj, dict) and all(check_format(substruct, obj[key]) for key, substruct in struct.items()) | |
if isinstance(struct, tuple): | |
return isinstance(obj, tuple) and all(check_format(substruct, obj[i]) for i, substruct in enumerate(struct)) | |
elif isinstance(struct, list): | |
return isinstance(obj, list) and all(check_format(struct[0], item) for item in obj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import base64 | |
import json | |
import hashlib | |
import os | |
import stat | |
import requests |
OlderNewer