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
#!/bin/bash | |
if [ "$(whoami)" != "root" ] | |
then | |
echo "run script as root" | |
fi | |
if [ ! "$1" ] | |
then | |
echo "give your username as first argument" |
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
Run dl.sh then one of the two python script. | |
You need at least BeautifulSoup and pprocess if you want to test the multiprocess script. |
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 | |
from urllib2 import urlopen | |
all_rows = [] | |
for brole in filter(None, map(lambda x: x.strip(), urlopen("https://nurpa.be/files/rp-SABAM.html").read().split("---"))): | |
#for brole in filter(None, map(lambda x: x.strip(), open("a").read().split("---"))): | |
row = {} | |
if brole[0] == "#": | |
year = int(brole.replace("#", "").strip()) |
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
from random import choice | |
def generate_grille(): | |
return [ | |
[-1, -1, -1], | |
[-1, -1, -1], | |
[-1, -1, -1], | |
] | |
def print_grille(grille): |
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
mkdir pdfs | |
cd pdfs | |
# first download everything | |
wget $(lynx -dump "http://www.lachambre.be/kvvcr/showpage.cfm?section=/cricra&language=fr&cfm=dcricra.cfm?type=plen&cricra=cri&count=all" | grep "[^x].pdf$" | purls | puniq) | |
# then transform everything | |
for i in *; do pdftotext $i; done | |
# then run the script |
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
[{"dossierid": "4ddebaac865c0c17de0004c2", "Abstain": {"total": "73", "groups": [{"votes": [{"id": "4de182cf0fb8127435bdbb2f", "orig": "Alvaro"}, {"id": "4de182c70fb8127435bdbb22", "orig": "Attwooll"}, {"id": "4de183530fb8127435bdbbea", "orig": "Beaupuy"}, {"id": "4de183490fb8127435bdbbdb", "orig": "Busk"}, {"id": "4de183d20fb8127435bdbcaa", "orig": "Cocilovo"}, {"id": "4de183d50fb8127435bdbcaf", "orig": "Costa Paolo"}, {"id": "4de1842a0fb8127435bdbd2e", "orig": "Davies"}, {"id": "4de184300fb8127435bdbd36", "orig": "De Sarnez"}, {"id": "4de184510fb8127435bdbd64", "orig": "Drčar Murko"}, {"id": "4de1843a0fb8127435bdbd46", "orig": "Duff"}, {"id": "4de184560fb8127435bdbd6a", "orig": "Duquesne"}, {"id": "4de184b30fb8127435bdbdeb", "orig": "Fourtou"}, {"id": "4de185110fb8127435bdbe78", "orig": "Gibault"}, {"id": "4de1855b0fb8127435bdbedf", "orig": "Hall"}, {"id": "4de1855f0fb8127435bdbee5", "orig": "Harkin"}, {"id": "4de185650fb8127435bdbeed", "orig": "Hennis-Plasschaert"}, {"id": "4de185590fb8127435bdbedd", "orig |
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
// ==UserScript== | |
// @name imgur anti glande | |
// @namespace *imgur.com* | |
// @description pour arrêter de perdre ma vie sur imgur | |
// @include *imgur.com* | |
// @match http://*.reddit.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== |
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
# make sure that this line is present in /etc/apt/sources.list: deb http://be.archive.ubuntu.com/ubuntu/ precise universe | |
sudo apt-get update | |
sudo apt-get install -y cabal-install libgnutls-dev liblz-dev libxml-sax-perl pkg-config libidn11-dev libxml2-dev libgsasl7-dev git | |
# if not present in your ~/.{z,ba}shrc | |
export PATH="$HOME/.cabal/bin:"$PATH | |
# if it's NOT present, git-annex won't be on your $PATH so you won't be able to use it | |
# if you want to use another directory for the bins, append "--bindir=$HOME/bin" to the cabal commands |
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 sys | |
from redbaron import RedBaron | |
red = RedBaron(open("../../django/hackeragenda/events/management/commands/fetch_events.py", "r").read()) | |
base_call = RedBaron("a()").call | |
sys.path.append("../../django/hackeragenda/events") | |
from colors import COLORS |
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
In [3]: from redbaron import RedBaron | |
In [4]: from colors import COLORS # this file https://github.com/Psycojoker/hackeragenda/blob/76b032ad6b3795eba1fd6224a83edf52833d1484/events/colors.py | |
In [5]: red = RedBaron(open("../../django/hackeragenda/events/management/commands/fetch_events.py", "r").read()) | |
# here I'm looking for the best way to get what I want | |
# I've cut a bug part of the output | |
In [6]: red("call") | |
Out[6]: |
OlderNewer