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
const calculateDelaunayPoints = (data, width, height, n) => { | |
// Initialize the variables | |
const pointsInput = new Float64Array(n * 2); | |
const centroid = new Float64Array(n * 2); | |
const stippling = new Float64Array(n); | |
// Initialize the pointsInput using rejection sampling. | |
for (let i = 0; i < n; ++i) { | |
for (let j = 0; j < 30; ++j) { |
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
input[type='checkbox'] { | |
outline: none !important; | |
padding: 0; | |
margin: 4px 0 0; | |
line-height: normal; | |
border: none; | |
-webkit-appearance: none; | |
appearance: none; | |
cursor: pointer; | |
} |
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
@keyframes scroll { | |
0% { transform: translateY(0%); } | |
100% { transform: translateY(-200%); } | |
} | |
.parent { | |
overflow: hidden; | |
position: relative; | |
} | |
.one { | |
position: absolute; |
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 React, { Component } from 'react'; | |
import 'intersection-observer'; // optional polyfill | |
import Observer from '@researchgate/react-intersection-observer'; | |
import ReactResizeDetector from 'react-resize-detector'; | |
import './styles.scss'; | |
let data = ['1', '2', '3', '4', '5', '6', '7', '8', '9']; | |
let heights = [184,58,96,144,68,98,150,200,240]; |
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
let postObject = posts.reverse().reduce((acc, ele) => { | |
if(acc.s > 0) { | |
return {arr: [ele, ...acc.arr], rows: acc.rows, s: acc.s-1} | |
} else { | |
return {arr: [ele], rows: [acc.arr, ...acc.rows], s: 2}; | |
} | |
}, {arr: [], rows: [], s: 3}); | |
let rows = [[...postObject.arr], ...postObject.rows ]; |
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 React, { Component } from 'react'; | |
import { BrowserRouter, Route } from 'react-router-dom'; | |
import { Security, ImplicitCallback } from '@okta/okta-react'; | |
import { OktaAuthComponent, OktaLogout } from './OktaAuthComponent.js' | |
const config = { | |
issuer: 'https://*****.oktapreview.com/oauth2/default', // replace this with your okta dev url | |
redirect_uri: window.location.origin + '/implicit/callback', | |
client_id: '****' // replace this with your okta client_id | |
} |
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
// src/OktaAuthComponent.js | |
import React, { Component } from 'react'; | |
import { Redirect } from 'react-router-dom'; | |
import { withAuth } from '@okta/okta-react'; | |
export const OktaAuthComponent = withAuth(class Auth extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { authenticated: null }; | |
this.checkAuthentication = this.checkAuthentication.bind(this); | |
this.checkAuthentication(); |
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 React, { Component } from 'react'; | |
import { BrowserRouter, Route } from 'react-router-dom'; | |
import { Security, ImplicitCallback } from '@okta/okta-react'; | |
import { OktaAuthComponent, OktaLogout } from './OktaAuthComponent.js' | |
const config = { | |
issuer: 'https://*****.oktapreview.com/oauth2/default', // replace this with your okta dev url | |
redirect_uri: window.location.origin + '/implicit/callback', | |
client_id: '****' // replace this with your okta client_id | |
} |
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
// src/OktaAuthComponent.js | |
import React, { Component } from 'react'; | |
import { Redirect } from 'react-router-dom'; | |
import { withAuth } from '@okta/okta-react'; | |
export const OktaAuthComponent = withAuth(class Auth extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { authenticated: null }; | |
this.checkAuthentication = this.checkAuthentication.bind(this); | |
this.checkAuthentication(); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="demo"></div> | |
<button onclick="start();">Start</button> |
NewerOlder