Skip to content

Instantly share code, notes, and snippets.

View daanklijn's full-sized avatar
👨‍🚀
Ready for take-off!

Daan Klijn daanklijn

👨‍🚀
Ready for take-off!
View GitHub Profile
@daanklijn
daanklijn / sum_aliexpress.js
Created April 27, 2021 21:51
One-liner to compute the total value of aliexpress orders on a single page.
// Run in the console at https://trade.aliexpress.com/orderList.htm
Array.from(document.querySelectorAll('.amount-num')).map(x => parseFloat(x.innerText.replace('€ ','').replace('$ ',''))).reduce((a,b) => a+b)
@daanklijn
daanklijn / conllu_csv_to_tree.py
Created May 3, 2021 10:46
CONLL-U dataframe to dependency tree
df = pd.read_csv('conllu.csv')
words = []
arcs = []
for index, row in df.iterrows():
words.append({
'text': row['word'],
'tag': row['pos']
})
dep_head = row['dependency_head'] - 1
dep_label = row['dependency_label']