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
"use strict"; | |
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: "stable", | |
// default font size in pixels for all tabs |
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 fetch from 'node-fetch'; | |
async function getTotalHoursWatched(userId) { | |
let page = `https://kitsu.io/api/edge/library-entries?filter[userId]=${userId}&include=anime&page[limit]=20`; | |
let totalMinutes = 0; | |
let totalEpisodes = 0; | |
const processedAnimeIds = new Set(); | |
let nullAnimeDataCount = 0; | |
while (page) { |
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
/* | |
Josh's Custom CSS Reset | |
https://www.joshwcomeau.com/css/custom-css-reset/ | |
*/ | |
*, *::before, *::after { | |
box-sizing: border-box; | |
} | |
* { | |
margin: 0; | |
} |
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
// @flow | |
import { useReducer } from 'react' | |
type AllowedStatus = 'idle' | 'processing' | 'error' | 'success' | |
const alllowedStatus = ['idle', 'processing', 'error', 'success'] | |
type Status = {| | |
state: AllowedStatus, |
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 { Route } from 'react-router-dom' | |
function RouteWrapper({ component: Component, layout: Layout, ...rest }) { | |
return ( | |
<Route | |
{...rest} | |
render={(props) => ( | |
<Layout {...props}> | |
<Component {...props} /> |
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, { useEffect, useRef, FunctionComponent, HTMLProps } from 'react'; | |
import 'intersection-observer'; // if you want to include a polyfill | |
/** | |
* Returns an IntersectionObserver that loads the image | |
* when it is at least {threshold}*100 visible in the viewport. | |
* | |
* PS: Cached on the window for performance | |
*/ | |
function getImageLoaderObserver( |
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 fs = require("fs"); | |
const path = require("path"); | |
const parser = require("@babel/parser"); | |
const traverse = require("@babel/traverse").default; | |
const babel = require("@babel/core"); | |
const resolve = require("resolve").sync; | |
let ID = -1; | |
function createModuleInfo(filePath) { |
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 { withAppContext } from '../../app/hocs/WithAppContext'; | |
/** | |
* withCachedObj | |
* HOC for reading/writing in-memory Context to/from localStorage | |
* useful for handling refresh/navigation etc.. | |
* @param {React.Node} Component | |
*/ | |
export default function withCachedObj(Component) { |
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
FROM golang:1.9 as builder | |
# Install dep tool | |
RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 && chmod +x /usr/local/bin/dep | |
WORKDIR /go/src/github.com/akramsaouri/gocker/ | |
COPY Gopkg.toml Gopkg.lock ./ | |
# Install dependencies without checking for go code | |
RUN dep ensure -vendor-only | |
COPY src ./src | |
# Build binary file | |
RUN CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo -o app ./src |
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 Let(f) { | |
let called = false | |
let v = null | |
return function () { | |
if(called) return v | |
console.log('evaluating.') | |
v = f() | |
called = true | |
return v | |
} |
NewerOlder