View stem.py
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 python | |
# -*- coding: utf-8 -*- | |
# vim: set fileencoding=utf-8 : | |
import nltk | |
import nltk.data | |
import re | |
from nltk.corpus import stopwords | |
from nltk.stem.snowball import SnowballStemmer | |
from vector_dict.VectorDict import VectorDict |
View test_fdj.py
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 | |
from archery import mdict | |
from functools import reduce | |
from random import randint, seed | |
from json import dumps | |
from sys import argv | |
pp = lambda d:print(dumps(d, indent=4)) | |
_seed = argv[1] | |
print(_seed) | |
seed(int(_seed)) |
View test.sh
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/bash | |
MIN_FF_OPT=" --headless " | |
FF="firefox $MIN_FF_OPT" | |
die() { echo "$@"; exit 0;} | |
fc-match Andika || die "le test va pas marcher" | |
echo "basically if I could create profile from scratch I would put only this" | |
cat <<EOF | |
user_pref("font.default.x-western", "Andika"); |
View gnuplot_plot
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 gnuplot | |
set timefmt '%Y-%m-%d' | |
set xdata time | |
set yrange [1<*:] | |
set format x '%Y-%m-%d' | |
set xrange ["2020-03-01"<*:] | |
set datafile sep ',' |
View control.sh
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/bash | |
MYPID=$$ | |
watchdog () { | |
( PID=$1 | |
DONE=0 | |
while [[ $DONE == 0 ]]; do | |
echo "watchdog running" | |
if $( kill -0 $PID ); then | |
sleep 1; | |
else |
View secrets.sh
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 -S bash -i | |
STASH=~/.secrets | |
RZ="\e[0m" | |
GR="\e[92m" | |
RD="\e[91m" | |
HL="\e[1m" | |
mkdir $STASH &> /dev/null | |
chmod 700 $STASH | |
if [ ! -z "$1" ]; then |
View calc4-2.py
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/python3.7 | |
from functools import reduce | |
push_to_stack=object() | |
stack=[] | |
OP="+/-*" | |
all_true=lambda x: True | |
def crush_stack(): | |
global stack |
View calc4.py
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/python3.7 | |
from functools import reduce | |
crush_stack=object() | |
stack=[] | |
dispatch={ | |
lambda x: True : | |
print, | |
str.isdigit : | |
lambda x: stack.append(int(x)), | |
lambda x: x in '+*/-' : |
View dict2graph.py
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 | |
# usage python3 dict2graph.py | xdot - | |
DIGRAPH = """digraph structs { | |
graph [ | |
rankdir= "TD" | |
bgcolor=white | |
] | |
node [ |
View evol.py
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 | |
# -*- coding: utf8 -*- | |
from pyquery import PyQuery as P | |
from archery import mdict | |
from archery.trait import Copier | |
from pyaml import dumps | |
import re | |
by3 = lambda s: "".join( | |
[ " " * int((i+1)%3==0) + x for i,x in enumerate(s[::-1])][::-1]).strip() |