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 html | |
def to_html(x): | |
if isinstance(x, (list, tuple, dict)): | |
if isinstance(x, (list, tuple)): | |
elements = "".join( | |
f"<li>[{ii}]: {to_html(elem)}</li>" for ii, elem in enumerate(x) | |
) | |
else: |
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 requests | |
import subprocess | |
import datetime | |
from bs4 import BeautifulSoup | |
def are_there_free_places(html): | |
soup = BeautifulSoup(html, 'html.parser') | |
places = soup.find(**{'data-label': 'Plätze: '}).text.strip() | |
return places == 'Noch Plätze frei' |
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 bs4 | |
import dateparser | |
import re | |
with open('/home/imartinezvazquez/rss/mp3_long.php') as fd: | |
doc = bs4.BeautifulSoup(fd.read()) | |
links = doc.find_all('a') | |
links = [l for l in links if l.attrs['href'].endswith('.mp3')] |
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
<?xml version='1.0' encoding='UTF-8'?> | |
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"> | |
<channel> | |
<title>Dhammatalks.org Lectures</title> | |
<link>https://www.dhammatalks.org/mp3_long.php</link> | |
<description>Dhammatalks.org Lectures</description> | |
<itunes:explicit>no</itunes:explicit> | |
<docs>http://www.rssboard.org/rss-specification</docs> | |
<generator>python-podgen v1.0.0 https://podgen.readthedocs.org</generator> | |
<lastBuildDate>Fri, 08 Feb 2019 17:23:37 +0000</lastBuildDate> |
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
<?xml version='1.0' encoding='UTF-8'?> | |
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"> | |
<channel> | |
<title>Dhammatalks.org Lectures</title> | |
<link>https://www.dhammatalks.org/mp3_long.php</link> | |
<description>Dhammatalks.org Lectures</description> | |
<itunes:explicit>no</itunes:explicit> | |
<docs>http://www.rssboard.org/rss-specification</docs> | |
<generator>python-podgen v1.0.0 https://podgen.readthedocs.org</generator> | |
<lastBuildDate>Fri, 08 Feb 2019 17:23:37 +0000</lastBuildDate> |
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
setlocal keywordprg=manspectre | |
setlocal foldmethod=expr | |
setlocal foldexpr=GetSpectreFold(v:lnum) | |
function! NextNonCommentLine(lnum) | |
let numlines = line('$') | |
let current = a:lnum + 1 | |
while current <= numlines |
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
def format_si(number, significant_digits=3): | |
"""Format number using SI prefixes | |
The prefix is chosen such that the number before the prefix is 1<x<1000.""" | |
if number == 0: | |
return '0 ' | |
prefixes = list('afpnμm') + [''] + list('kMGTPE') | |
multipliers = 10.**np.arange(-18, 19, 3) | |
inv_multipliers = 10.**(-np.arange(-18, 19, 3)) | |
abs_number = abs(number) |
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
{ | |
"metadata": { | |
"name": "" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ |
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
{ | |
"translatorID": "d1b38d36-6bcc-4828-969f-b08a2a2e0723", | |
"label": "Libgen", | |
"creator": "Ignacio Martinez V.", | |
"target": "libgen\\.org|gen\\.lib\\.rus\\.ec", | |
"minVersion": "1.0", | |
"maxVersion": "", | |
"priority": 100, | |
"inRepository": true, | |
"translatorType": 4, |