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 * as React from "react"; | |
import { useMousePosition } from "~/hooks/useMousePosition"; | |
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */ | |
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) { | |
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {}; | |
const [mouseX, mouseY] = useMousePosition(); | |
const positions = { x, y, h, w, mouseX, mouseY }; | |
return ( | |
<div |
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 download(csv) { | |
if (csv == null) return | |
const filename = `export-${new Date()}.csv` | |
if (!csv.match(/^data:text\/csv/i)) { | |
csv = 'data:text/csv;charset=utf-8,' + csv | |
} | |
const data = encodeURI(csv) |
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
type Method = 'get' | 'post' | 'put' | 'delete' | |
type Handler = (req: Request) => Promise<any> | |
function route (method: Method, path: string, handler: Handler) { | |
app[method](path, (req, res, next) => { | |
handler(req) | |
.then(result => result ? res.json(result) : res.status(204).end('')) | |
.catch(next) | |
}) | |
} |
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
{ | |
"editor.fontFamily": "FiraCode-Light", | |
"editor.fontLigatures": true, | |
"window.zoomLevel": 4, | |
"prettier.printWidth": 140, | |
"prettier.semi": false, | |
"prettier.singleQuote": true, | |
"prettier.trailingComma": "all", | |
"editor.formatOnSave": true, | |
"workbench.iconTheme": "seti", |
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 * as React from 'react' | |
import Table from '@material-ui/core/Table' | |
import TableBody from '@material-ui/core/TableBody' | |
import TableHead from '@material-ui/core/TableHead' | |
import TableRow from '@material-ui/core/TableRow' | |
import TableCell from '@material-ui/core/TableCell' | |
const ArrayOf = ({ type }) => ( | |
<React.Fragment> |
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 http = require('http') | |
const httpProxy = require('http-proxy') | |
const PORT = 3005 | |
const TARGET = 'http://example.com:80' | |
const USER = '' | |
const PASSWORD = '' | |
const options = { | |
auth: `${USER}:${PASSWORD}`, |
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
vlc \ | |
screen:// \ | |
-I rc \ | |
--screen-left=0 --screen-top=0 --screen-width=800 --screen-height=600 \ | |
--sout "#transcode{vcodec=h264,vb=800,fps=5,scale=1,acodec=none}:duplicate{dst=std{access=file,mux=mp4,dst='./screen.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
FROM node:7 | |
RUN apt-get update &&\ | |
apt-get install -y libgtk2.0-0 libgconf-2-4 \ | |
libasound2 libxtst6 libxss1 libnss3 xvfb | |
# Exposing port 5000 (micro) | |
EXPOSE 5000 | |
WORKDIR /app |
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
#!/usr/bin/env bash | |
set -e | |
# Start Xvfb | |
Xvfb -ac -screen scrn 1280x800x24 :9.0 & | |
export DISPLAY=:9.0 | |
exec "$@" |
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
``` | |
Portage 2.3.5 (python 2.7.12-final-0, hardened/linux/amd64/selinux, gcc-5.4.0, glibc-2.23-r3, 4.9.24-hardened x86_64) | |
================================================================= | |
System uname: Linux-4.9.24-hardened-x86_64-AMD_Ryzen_7_1800X_Eight-Core_Processor-with-gentoo-2.3 | |
KiB Mem: 16246768 total, 11212408 free | |
KiB Swap: 16777212 total, 16777212 free | |
Timestamp of repository gentoo: Sat, 20 May 2017 03:00:01 +0000 | |
sh bash 4.3_p48-r1 | |
ld GNU ld (Gentoo 2.26.1 p1.0) 2.26.1 |
NewerOlder