Skip to content

Instantly share code, notes, and snippets.

💭
/o\

Nikolaus Piccolotto prayerslayer

💭
/o\
Block or report user

Report or block prayerslayer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@prayerslayer
prayerslayer / elapsed_by_keyword.py
Created Jan 28, 2019
Find slow Robot Framework keywords
View elapsed_by_keyword.py
#!/usr/bin/env python
"""Usage: elapsed_by_keyword path/to/output.xml
Reads result of a test run from Robot output file
and outputs "keyword elapsed_time"
sorted by the elapsed time in each keyword.
"""
import sys
@prayerslayer
prayerslayer / find_color.js
Created May 7, 2018
Find used colors on page
View find_color.js
function colorCount() {
function trim(str) {
return str.replace(/^\s+|\s+$/gm, '');
}
function toComponents(str) {
return str.match(/rgba?\((.+)\)/)[1].split(',').map(s => s.trim()).map(s => parseInt(s, 10))
}
function componentToHex(c) {
@prayerslayer
prayerslayer / gist.js
Last active Sep 29, 2017
8x8 Matrix with 10 1s on random positions
View gist.js
function shuffle(a) {
for (let i = a.length; i; i--) {
let j = Math.floor(Math.random() * i);
[a[i - 1], a[j]] = [a[j], a[i - 1]];
}
return a;
}
function range(n) {
return new Array(n).fill(0).map((_, i) => i);
@prayerslayer
prayerslayer / output.txt
Last active Sep 28, 2015
Tests JSON encoding performance of different clojure libs
View output.txt
content length
5073891
cheshire
"Elapsed time: 103.332902 msecs"
clj-json
"Elapsed time: 79.033905 msecs"
core.json
"Elapsed time: 638.59961 msecs"
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
stroke-width: 1.5px;
}
</style>
<body>
View README.md
You can’t perform that action at this time.