Skip to content

Instantly share code, notes, and snippets.

View rafinskipg's full-sized avatar
🏠
Working from home

Venture rafinskipg

🏠
Working from home
  • web3
  • Worldwide
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
const MAX_DEVIATION_SUPPORTED = 0.35
function average(items) {
const total = items.reduce((prev, next) => {
return prev + next
}, 0)
return total / items.length
}
class Calculator {
// This is an empty class
}
describe("Calculator", function() {
var calculator;
beforeEach(function() {
calculator = new Calculator();
});
it("should have an add method", function() {
expect(calculator.add).toBeDefined()
});
});
class Calculator {
add = () => {
// Empty method
}
}
describe('add method', () => {
it('should return 4 when receiving 2 and 2', () => {
expect(calculator.add(2, 2)).toEqual(4)
})
})
class Calculator {
add = () => {
return 4
}
}
describe('add method', () => {
it('should return a SUM when receiving two different numbers', () => {
for (var i = 0; i < 100; i++) {
const valueA = Math.round(Math.random() * 100)
const valueB = Math.round(Math.random() * 100)
const sum = valueA + valueB
expect(calculator.add(valueA, valueB)).toEqual(sum)
}
})
})
class Calculator {
add = (a, b) => {
return a + b
}
}
const fs = require('fs')
const ffmpeg = require('fluent-ffmpeg')
const path = require('path')
const FRAMES_PER_SECOND = 30
const framesFolder = path.resolve('myfolder', 'videos', 'frames')
function getAllFilesFromFolder(folderPath, extension) {
return new Promise((resolve, reject) => {