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 isEmpty from "lodash/isEmpty"; | |
import List from "@material-ui/core/List"; | |
import { Item, File } from "../types"; | |
import FileItem from "./FileItem"; | |
import FolderItem from "./FolderItem"; | |
import Placeholder from "./Placeholder"; | |
export default function ItemList({ data }: { data: Item[] }) { | |
if (isEmpty(data)) { | |
return ( |
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 { mutate } from "swr"; | |
import { Widget } from "@uploadcare/react-widget"; | |
import { Drive } from "../types"; | |
export default function Uploader({ drive }: { drive: Drive }) { | |
if (drive.provider === "uploadcare") { | |
return ( | |
<> | |
<label>Upload a file: </label> | |
<Widget |
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 { 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(); |
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 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 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 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 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 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 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 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" |
NewerOlder