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
gource --start-date '2019-01-01' -1280x720 --seconds-per-day 0.05 --auto-skip-seconds 0.5 --title "open/web-player" --dir-name-depth 2 --file-idle-time 0 --hide filenames --file-show-filter open/web-player,shared --output-ppm-stream - --output-framerate 30 --camera-mode overview --stop-at-end | ffmpeg -y -r 30 -f image2pipe -vcodec ppm -i - -b 65536K offline2.mp4 |
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 TOTAL_STACK = 1024 * 1024; // 1MB | |
const TOTAL_MEMORY = 2 * 1024 * 1024; // 1MB | |
const WASM_PAGE_SIZE = 64 * 1024; // Defined in WebAssembly specs | |
/** | |
* Implementation of atob() according to the HTML and Infra specs, except that | |
* instead of throwing INVALID_CHARACTER_ERR we return null. | |
*/ | |
function atobb(data) { | |
// Web IDL requires DOMStrings to just be converted using ECMAScript |
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
/** Measures framerate for the time between start() and stop() calls */ | |
function FramerateMeasurer () { | |
this.start = () => { | |
this._beginTime = ( performance || Date ).now() | |
this._frames = 0 | |
this._animationFrameId = requestAnimationFrame(this._loop) | |
} | |
this.stop = () => { | |
const endTime = ( performance || Date ).now() |
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 { OnDemandLiveRegion } from './OnDemandLiveRegion'; | |
describe('OnDemandLiveRegion', () => { | |
beforeEach(() => { | |
document.body.innerHTML = ''; | |
jest.useFakeTimers(); | |
}); | |
test('works with defaults', () => { | |
const liveRegion = new OnDemandLiveRegion(); |
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 autoCorrelation(arr) { | |
var ac = new Float32Array(2048); | |
for (var lag = 0; lag < arr.length; lag++) { | |
var value = 0; | |
for (var index = 0; index < arr.length - lag; index++) { | |
let a = arr[index]; | |
- let b = arr[index-lag]; | |
+ let otherindex = index - lag; | |
+ let b = otherindex >= 0 ? arr[index-lag] : 0; | |
value = value + a * b; |
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
// paste this in any JS REPL to see the execution! | |
// Note that the fakeAPI is simulated to be flaky so try executin this a few times | |
// to see both the success and failure case | |
(() => { | |
/** | |
* Wrap a promise API with a function that will attempt the promise over and over again | |
* with exponential backoff until it resolves or reaches the maximum number of retries. | |
* - First retry: 500 ms + <random> ms | |
* - Second retry: 1000 ms + <random> ms | |
* - Third retry: 2000 ms + <random> ms |
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
header.all: 'جميعها بجوار {0}' | |
header.popular: 'حفلات موسيقية شعبية بجوار {0}' | |
header.near_you: بجوارك | |
header.near_location: 'بجوار {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
const users = [<User name="Fannar"/>, <User name="Tryggvi"/>] | |
before | |
<div> | |
{users.map((user, index) => <User key={index} name={user.name} />)} | |
</div> | |
after |
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, { Component } from 'react'; | |
import data from '../../data/data' | |
import Header from './header'; | |
import EducationList from './EducationList'; | |
import SkillList from './SkillList'; | |
class Main extends Component { |
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, { Component } from 'react'; | |
class Card extends Component { | |
render() { | |
return ( | |
<div className = "Card"> | |
<div style= {{backgroundColor : this.props.color}}className = "Card__title-container"> | |
<h6 className = "Card__title"> |
NewerOlder