IOT spooks: - https://ghostbin.com/paste/q2vq2
This file contains 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
const exjson = require('./index.js'); | |
const test = require('./test.json'); | |
const process = require('process'); | |
[exjson.stringify, JSON.stringify].forEach(f => { | |
let time = process.hrtime(); | |
let length = f(test2).length; | |
let diff = process.hrtime(time); | |
console.log(diff[0], 'seconds', diff[1], 'nanoseconds') | |
console.log(length); |
This file contains 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
const f = require('faker'); | |
let dup = (a) => a.map((el) => Object.assign({}, el)); | |
// https://stackoverflow.com/questions/6274339/how-can-i-shuffle-an-array | |
const shuffle = (a) => { | |
for (let i = a.length - 1; i > 0; i--) { | |
const j = Math.floor(Math.random() * (i + 1)); | |
[a[i], a[j]] = [a[j], a[i]]; | |
} |
This file contains 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
#[cfg(test)] | |
mod tests { | |
use average; | |
#[test] | |
fn test_average() { | |
let items = vec!(3.0, 4.0, 5.0); | |
unsafe { | |
assert_eq!(average::average(&items), 4.0); | |
} |
This file contains 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
#!/usr/bin/python3 | |
# Author: julianknodt | |
# -- Description | |
# A git pre-commit hook that will run clang-format on only modified lines. | |
import subprocess | |
import os | |