Skip to content

Instantly share code, notes, and snippets.

@baptiste-roullin
baptiste-roullin / raindrop-to-eagle.py
Last active May 24, 2024 21:08
Crude script to export Raindrop bookmarks and images into Eagle.app
# Crude, offensively non-pythonic script to export Raindrop bookmarks in Eagle.app, as URL objects or media.
# Needs a CSV export from a Raindrop collection. https://help.raindrop.io/export/
# The collection needs to be set to public.
import csv
from random import choice
import re
from sys import argv
from os import path, sep, mkdir
from datetime import datetime
/*
Narrow non-breaking space before ? ! ; :
espaces fines insécables avant ? ! ; :
*/
import markdownIt from 'markdown-it'
const all = document.querySelectorAll('*')
for (var i = all.length - 1; i >= 0; i--) {
const after = window.getComputedStyle(all[i], ':after').content
const before = window.getComputedStyle(all[i], ':before').content
if (after !== 'none' && after !== '\"\"') {console.log(after)}
if (before !== 'none' && before !== '\"\"') {console.log(before)}
}
@baptiste-roullin
baptiste-roullin / gist:b936414be1b827af3a82e84b06d593e0
Created December 31, 2019 22:03
Extract task results from Optimal workshop
// Extract duration, success rate and directness from the task results tab of a study and copy it to the clipboard
// Launch the script three times, with n in `div:nth-child(n)`replaced by 1, 2, 3.
{
let selector = document.querySelectorAll(".results-task-body .task-charts > div:nth-child(n) .box-plot-label");
let a = []
Array.from(selector).forEach(function(el){a.push(el.textContent.replace(/[ |\n\n|sec]/g,""))});
let output = a.join('\n');
console.log(output);
copy(output)
@baptiste-roullin
baptiste-roullin / select_and_scrape.js
Last active August 16, 2022 11:38
Open the Firefox or Chrome Devtools, select an element and execute the script, wich copies to the clipboard the text of similar elements. You may need to tweak the CSS selector.
let a=[];
selector = "." + $0.className.replace(/\s/g, '.');
Array.from($$(selector)).forEach(function(el){a.push(el.textContent)});
let output = a.join('\n');
console.log(output);
copy(output);
//copy([...document.querySelectorAll(".task-container__name")].map(el => el.textContent).join('\n'))
// >
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// The most epic theme for Sublime Text 3
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[
//
// @EMPTY WINDOW
// Style for empty (no tabs) window
@baptiste-roullin
baptiste-roullin / snippets.css
Last active December 8, 2018 13:19
Snippets css
/*
CSS injections used with the Stylus Firefox extension.
*/
/*
In Icescrum, the textareas where you describe stories are teeny-tiny. This fixes it.
*/
@-moz-document domain("") {
@baptiste-roullin
baptiste-roullin / untrusted-lvl7-solution.js
Last active August 29, 2015 14:00 — forked from anonymous/untrusted-lvl7-solution.js
A convoluted solution of mine to a level of Untrusted http://alexnisnevich.github.io/untrusted/
/*************
* colors.js *
*************
*
* You're almost at the exit. You just need to get past this
* color lock.
*
* Changing your environment is no longer enough. You must
* learn to change yourself. I've sent you a little something
* that should help with that.
@baptiste-roullin
baptiste-roullin / SassMeister-input-HTML.html
Created March 11, 2014 11:34
Just messing with SASS to output parametric color scheme
<div class="item-1"></div>
<div class="item-2"></div>
<div class="item-3"></div>
<div class="item-4"></div>
<div class="item-5"></div>
<div class="item-6"></div>