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
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get update | |
sudo apt-get -y install docker-ce | |
sudo service docker restart | |
sudo rm /usr/local/bin/docker-compose | |
curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose | |
chmod +x docker-compose | |
sudo mv docker-compose /usr/local/bin |
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
function mapObject<K extends keyof any, T, TResult>(obj: Record<K, T>, makeResult: (val: T, key?: K) => TResult): Record<K, TResult> { | |
return (Object.keys(eventMap) as K[]).reduce( | |
(acc, key) => ({ | |
...acc, | |
[key]: makeResult(obj[key]), | |
}), | |
{} as Record<K, TResult> | |
); | |
} |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" | |
"net" | |
"net/http" |
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
{ | |
"basics": { | |
"name": "Sergey Todyshev", | |
"label": "Programmer, simplifier, optimizer", | |
"summary": "I'm a software engineer with 18 years of professional experience. I have expert knowledge in C#, TypeScript and many other languages I use to develop amazing products. I am proactive doer, simplifier and optimizer. Efficiency, readability and simplicity matters for me.", | |
"picture": "https://avatars3.githubusercontent.com/u/190322?s=460&u=b87d4e8a9c8b452b1b96f1a6dc615865909e901f&v=4", | |
"email": "[email protected]", | |
"phone": "+79132017700", | |
"website": "https://tsvbits.com", | |
"profiles": [ |
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
export type ItemType = "file" | "folder"; | |
export interface Item { | |
type: ItemType; | |
id: string; | |
name: string; | |
path: string; | |
driveId: string; | |
} |
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 axios from "axios"; | |
import { Drive, File, Item } from "../types"; | |
import { checkResponseOK } from "./utils"; | |
type Options = { | |
type: string; | |
id: string; | |
name: string; | |
publicKey: string; | |
secretKey: string; |
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 axios from "axios"; | |
import trimStart from "lodash/trimStart"; | |
import { Drive, Item, File } from "../types"; | |
import { checkResponseOK, downloadBlob, trimPrefix } from "./utils"; | |
type Options = { | |
type: string; | |
id: string; | |
name: string; | |
accessToken: string; |
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 isEmpty from "lodash/isEmpty"; | |
import useSWR from "swr"; | |
import { getDrives } from "../core/store"; | |
import Loader from "../components/Loader"; | |
import Placeholder from "../components/Placeholder"; | |
import DriveList from "../components/DriveList"; | |
export default function Home() { | |
const { data: drives } = useSWR("/drives", getDrives); | |
if (!drives) { |
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 Link from "next/link"; | |
import ListItem from "@material-ui/core/ListItem"; | |
import ListItemAvatar from "@material-ui/core/ListItemAvatar"; | |
import Avatar from "@material-ui/core/Avatar"; | |
import { SiDropbox as DropboxIcon } from "react-icons/si"; | |
import { FiHardDrive as DriveIcon } from "react-icons/fi"; | |
import ListItemText from "@material-ui/core/ListItemText"; | |
import ListItemSecondaryAction from "@material-ui/core/ListItemSecondaryAction"; | |
import List from "@material-ui/core/List"; | |
import { Drive } from "../types"; |
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 { useRouter } from "next/router"; | |
import useSWR from "swr"; | |
import { Box } from "@material-ui/core"; | |
import { getDrive } from "../../core/store"; | |
import Loader from "../../components/Loader"; | |
import ItemList from "../../components/ItemList"; | |
import Uploader from "../../components/Uploader"; | |
export default function DriveView() { | |
const router = useRouter(); |