This file contains hidden or 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
import math | |
import time | |
PHI = (1.0 + math.sqrt(5))/2.0 | |
def fibonacci_for(N): | |
for_loop = [0] | |
def fib(N): |
This file contains hidden or 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
# Copyright (c) 2018 James Sharkey (https://github.com/jsharkey13/facebook_message_parser) | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in all |
This file contains hidden or 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
// See https://stackoverflow.com/questions/52172067/create-svg-hexagon-points-with-only-only-a-length | |
const round_4dp = function(x) {return Math.round(x*10000)/10000}; | |
const radius = 125; | |
const height = 260; | |
const width = 220; | |
const points = [0, 1, 2, 3, 4, 5, 6].map((n, i) => { | |
var angle_deg = 60 * i - 30; | |
var angle_rad = Math.PI / 180 * angle_deg; | |
return [round_4dp(width/2 + radius * Math.cos(angle_rad)), round_4dp(height/2 + radius * Math.sin(angle_rad))]; |
This file contains hidden or 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
# zpool disk latency visualisation | |
# | |
# This script parses the output of the zpool stats command: | |
# zpool iostat -pvwH | |
# which provides per-disk latency information for reads and writes. | |
# | |
# Run the command: | |
# | |
# zpool iostat -pvwH > output.tsv | |
# |