Skip to content

Instantly share code, notes, and snippets.

Avatar
💉
Pfized Twice

Radoslaw Ejsmont rejsmont

💉
Pfized Twice
  • CRI
  • Paris, France
View GitHub Profile
View superheroines.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rejsmont
rejsmont / swarmify.py
Last active Jan 5, 2021
Create a swarm in native matplotlib of out any scatter plot series
View swarmify.py
# Based on swarmplot code from seaborn - slightly adapted to take either a PathCollection or a list of PathCollections,
# thus enabling a hybrid swarm of scatter plots using different markers.
# Source: https://github.com/mwaskom/seaborn/blob/f1852b584c3edb750cfc0ee7c6cf6b34453ca5c9/seaborn/categorical.py
# License and copyright: https://github.com/mwaskom/seaborn/blob/master/LICENSE
# Comments from the source removed for brevity
def swarmify(ax, swarm, width, **kws):
def could_overlap(xy_i, swarm, d):
_, y_i = xy_i
View ariane.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rejsmont
rejsmont / anr_check.py
Created Sep 11, 2020
Check if the results for ANR grant committee are available
View anr_check.py
import re, requests
from urllib.request import urlopen
from lxml import etree
def committee_available(comm):
url = 'https://anr.fr/fr/detail/call/appel-a-projets-generique-2020/'
headers = {'Content-Type': 'text/html',}
response = requests.get(url, headers=headers)
html = response.text
htmlparser = etree.HTMLParser()
@rejsmont
rejsmont / chrome-stream-dl
Created Mar 21, 2020
Download stream from Chrome playlist cURL
View chrome-stream-dl
#!/usr/bin/env python3
import os
print("Enter output filename:")
name = input()
print("Paste cURL command string:")
cmd = input()
headers = []
@rejsmont
rejsmont / covid-19-wikipedia.py
Last active Mar 20, 2020
Fetch COVID-19 data for a country from Wikipedia
View covid-19-wikipedia.py
import requests
import pandas as pd
def get_wikipedia_data(country):
s = requests.Session()
url = "https://en.wikipedia.org/w/api.php"
p = {
"action": "query",
@rejsmont
rejsmont / compact.py
Last active Aug 29, 2015
Compact sparse matrix
View compact.py
#! /usr/bin/python
from __future__ import division
from __future__ import print_function
import csv
import argparse
import numpy
import numpy.linalg
import numpy.random
@rejsmont
rejsmont / AclFilter.php
Last active Feb 14, 2019
ACL filter for Doctrine QueryBuilder and Query. Supports multiple filters applied to a single query, entity inheritance and role hierarchies.
View AclFilter.php
<?php
/*
* Copyright 2013 Radoslaw Kamil Ejsmont <radoslaw@ejsmont.net>
*
* Original code by mailaneel is available at
* https://gist.github.com/mailaneel/1363377
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.