Skip to content

Instantly share code, notes, and snippets.

View x4d3's full-sized avatar

Xavier Delamotte x4d3

View GitHub Profile
{
"organizations": [
"org-mno"
],
"hist_parameters": {
"from": "2015-08-01",
"to": "2015-09-29",
"period": "MONTHLY"
},
"dates": [
{
"organizations": [
"org-mno"
],
"hist_parameters": {"from": "2015-08-01", "to": "2015-09-29", "period": "MONTHLY"},
"dates": [
"2015-08-31",
"2015-09-29"
],
"account_list": [
@x4d3
x4d3 / stopwatch.rb
Last active October 25, 2018 13:10 — forked from ikenna/stopwatch.rb
Simple Ruby stopwatch
class Stopwatch
def initialize
@start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
end
def elapsed_time
Process.clock_gettime(Process::CLOCK_MONOTONIC) - @start_time
end
end
@x4d3
x4d3 / gist:fd39936f966da5e22f2a642ce6fb8c72
Last active July 31, 2021 19:19 — forked from karlgroves/gist:7544592
Get DOM path of an element
const getDomPath = node => {
const stack = [];
let el = node;
while (el.parentNode != null) {
let siblingCount = 0;
let siblingIndex = 0;
for (let i = 0; i < el.parentNode.childNodes.length; i += 1) {
const sib = el.parentNode.childNodes[i];
if (sib.nodeName === el.nodeName) {