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
function decimalExpansion(numerator, denominator) { | |
// Special case for 0 | |
if (denominator === 0) { | |
return null; | |
} else if (numerator === 0) { | |
return { whole: 0, nonRecurring: "", recurring: null }; | |
} | |
const whole = Math.floor(numerator / denominator); | |
let remainder = numerator % denominator; |
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
import React, { | |
useRef, | |
useImperativeHandle | |
} from "react"; | |
import useAnimationFrame from "../hooks/animationFrame"; | |
type UpdateHandler = (dt: number, canvas: HTMLCanvasElement) => void; | |
export interface CanvasProps extends React.CanvasHTMLAttributes<HTMLCanvasElement> { | |
onAnimationFrame: UpdateHandler; |
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
/* | |
Compress (gzip) JSON-serialisable object and output as base 64; Decompress base 64 data and output as parsed JSON. | |
Useful for URLs, e.g. | |
Compress: | |
const bigObject = { ...lotsOfData }; | |
const url = "https://www.example.com/?" + await compressToUrl(bigObject); |
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
[ | |
{ | |
"label": "1850's Daguerrotype", | |
"value": "Daguerrotype", | |
"filters": [ | |
"photography", | |
"digital art" | |
] | |
}, | |
{ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>xAPI Form Example</title> | |
<!-- xAPI base functionality, from: https://github.com/RusticiSoftware/TinCanJS/blob/master/build/tincan-min.js --> | |
<script src="tincan-min.js"></script> | |
<!-- Setting up the xAPI connection from launch data --> | |
<script src="xapi-interface.js"></script> |
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
import React, { useRef, useEffect, useCallback, useState } from "react"; | |
type UpdateHandler = (dt: number) => void; | |
type ContextRenderer = (ctx: CanvasRenderingContext2D) => void; | |
export interface IAnimatedCanvasProps { | |
width: number; | |
height: number; | |
onFrame: UpdateHandler; | |
render: ContextRenderer; |
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
Moved to: https://github.com/dcollien/mp4filechecker/blob/master/src/index.ts |
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
<html> | |
<head> | |
<title>Simple xAPI Example</title> | |
<script src="tincan-min.js"></script> | |
</head> | |
<body> | |
<p>This is an xAPI Example</p> | |
<button type="button" id="complete-button">Send Completion Statement</button> | |
<span id="status"></span> | |
<script> |
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
import time | |
import urllib.parse | |
import hmac | |
import hashlib | |
import base64 | |
SB_NAME = "ol-events" | |
EH_NAME = "ol-user-metrics" | |
SAS_NAME = "collect-user-metric" | |
SAS_VALUE = "EXAMPLE-TOKEN" |
NewerOlder