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 cheerio = require('cheerio') | |
| const axios = require('axios').default | |
| async function fetchFollowerCounts(usernames) { | |
| const followerData = usernames.map((username) => { | |
| return axios.get(`https://mobile.twitter.com/${username}`).then((res) => { | |
| const $ = cheerio.load(res.data) | |
| const searchContext = `a[href='/${username}/followers']` | |
| const followerCountString = $(searchContext) | |
| .text() |
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 webpack = require('webpack'); | |
| const path = require('path'); | |
| const BabiliPlugin = require('babili-webpack-plugin'); | |
| const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
| // Config directories | |
| const SRC_DIR = path.resolve(__dirname, 'src'); | |
| const ASSETS_DIR = path.resolve(__dirname, 'assets'); | |
| const OUTPUT_DIR = path.resolve(__dirname, 'dist'); |
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
| struct CeloName { | |
| var value: String { | |
| #if DEBUG | |
| return (DebugSettings().showCeloAssetName || FeatureFlags().showCeloNameEnabled) ? "CELO" : "cGLD" | |
| #else | |
| return FeatureFlags().showCeloNameEnabled ? "CELO" : "cGLD" | |
| #endif | |
| } | |
| } |
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 from 'react' | |
| import useFileHandlers from './useFileHandlers' | |
| import './App.css' | |
| const Input = (props) => ( | |
| <input | |
| type='file' | |
| accept='image/*' | |
| name='img-loader-input' | |
| multiple |
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
| .container { | |
| padding: 8px; | |
| width: 100%; | |
| box-sizing: border-box; | |
| overflow-x: hidden; | |
| } | |
| .form { | |
| position: relative; | |
| width: 100%; |
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 from 'react' | |
| import useFileHandlers from './useFileHandlers' | |
| import './App.css' | |
| const Input = (props) => ( | |
| <input | |
| type='file' | |
| accept='image/*' | |
| name='img-loader-input' | |
| multiple |
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 { useCallback, useEffect, useReducer, useRef } from 'react' | |
| const api = { | |
| uploadFile({ timeout = 550 }) { | |
| return new Promise((resolve) => { | |
| setTimeout(() => { | |
| resolve() | |
| }, timeout) | |
| }) | |
| }, |
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 reducer = (state, action) => { | |
| switch (action.type) { | |
| case 'load': | |
| return { ...state, files: action.files, status: LOADED } | |
| case 'submit': | |
| return { ...state, uploading: true, pending: state.files, status: INIT } | |
| case 'next': | |
| return { | |
| ...state, | |
| next: action.next, |
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 reducer = (state, action) => { | |
| switch (action.type) { | |
| case 'load': | |
| return { ...state, files: action.files, status: LOADED } | |
| case 'submit': | |
| return { ...state, uploading: true, pending: state.files, status: INIT } | |
| case 'next': | |
| return { | |
| ...state, | |
| next: action.next, |
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 countRef = useRef(0) | |
| // Processes the next pending thumbnail when ready | |
| useEffect(() => { | |
| if (state.pending.length && state.next) { | |
| const { next } = state | |
| api | |
| .uploadFile(next) | |
| .then(() => { | |
| const prev = next |
NewerOlder