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 ( | |
"fmt" | |
"os" | |
"time" | |
) | |
type Pomodoro struct { | |
turnChan, shortBreakChan, longBreakChan, exit chan bool |
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" | |
"log" | |
"net" | |
"strings" | |
) |
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 ( | |
"html/template" | |
"log" | |
"net/http" | |
"os" | |
"path/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
// 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', |
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 | |
} |
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
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
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, { 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
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} /> |
OlderNewer