View CandlesticksChart.tsx
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, { ReactNode, useMemo } from "react"; | |
import { Bar, RectangleProps, ComposedChart } from "recharts"; | |
import { CategoricalChartProps } from "recharts/types/chart/generateCategoricalChart"; | |
export interface CandlestickData { | |
open?: number; | |
high?: number; | |
low?: number; | |
close?: number; | |
} |
View TimeAgo.js
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'; | |
const SECOND = 1000, | |
MINUTE = SECOND * 60, | |
HOUR = MINUTE * 60, | |
DAY = HOUR * 24, | |
MONTH = DAY * 30, | |
YEAR = DAY * 365; | |
export const getTimeAgoString = (timestamp) => { |
View url.js
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
export function encodeURLParams(params) { | |
return Object | |
.entries(params) | |
.sort((a, b) => a[0] - b[0]) | |
.reduce((search, entry) => [ | |
...search, | |
entry | |
.map(encodeURIComponent) | |
.join('=') | |
], []) |
View Group.css
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
.Group-item, | |
.Group-item.ui, | |
.Group-item.ui:first-child { | |
display: block; | |
margin-top: 1em; | |
} | |
.Group-item-enter.Group-item-enter-active { | |
transition: opacity 300ms ease-in, margin 300ms ease-out; | |
} |
View Terminal.css
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 url('https://cdn.rawgit.com/tonsky/FiraCode/1.204/distr/fira_code.css'); | |
body { | |
background-color: #212121; | |
font-family: HelveticaNeue, 'Helvetica Neue', 'Lucida Grande', Arial, sans-serif; | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscale; | |
} | |
.App { |
View api.js
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
export function paramsString(args) { | |
return Object | |
.keys(args) | |
.map(k => `${encodeURIComponent(k)}=${encodeURIComponent(args[k])}`) | |
.join('&'); | |
} | |
// localStorage.clear(); | |
export class APIRequest { |
View websocket-event-client.js
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
var app = { | |
url: "ws://" + document.location.hostname | |
}; | |
app.socket = new WebSocket(app.url + ":8082"); | |
app | |
.socket | |
.addEventListener('message', function(e) { | |
var message = JSON.parse(e.data); | |
var event = new CustomEvent(message.type); |
View blur-background.css
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
*[data-blur-background] { | |
position: relative; | |
overflow: hidden; | |
z-index: 1; | |
} | |
*[data-blur-background]::before, *[data-blur-background]::after { | |
position: absolute; | |
display: block; | |
z-index: -1; | |
content: ' '; |
View time-ago.js
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 timeAgo(time) { | |
'use strict'; | |
var second = 1000, | |
minute = second * 60, | |
hour = minute * 60, | |
day = hour * 24, | |
month = day * 30, | |
year = day * 365, | |
elapsed = Date.now() - time, | |
getString = function (value, unit) { |
NewerOlder