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 repo | |
import ( | |
"gopkg.in/mgo.v2" | |
"app/db" | |
"app/model" | |
) | |
/** |
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 workers | |
import ( | |
"app/repo" | |
"app/ws" | |
"github.com/bitly/go-nsq" | |
) | |
/* |
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 ( | |
"net/http" | |
"os" | |
"app/api" | |
"app/db" | |
"app/repo" | |
"app/worker" |
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 api | |
import ( | |
"log" | |
"encoding/json" | |
"net/http" | |
"app/repo" | |
"app/worker" | |
"app/model" |
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
var keystone = require('keystone'); | |
var Types = keystone.Field.Types; | |
/** | |
* Job Model | |
* ========== | |
*/ | |
var Job = new keystone.List('Job'); | |
Job.add({ |
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
nsqlookupd: | |
image: nsqio/nsq | |
command: /nsqlookupd | |
ports: | |
- "4160" | |
- "4161" | |
nsqd: | |
image: nsqio/nsq | |
links: | |
- nsqlookupd |
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 SET_INFO = 'SET_INFO'; | |
const SET_ERROR = 'SET_ERROR'; | |
const initialState = { | |
info: {}, | |
error: null | |
}; | |
const reducer = (state, action) => { | |
switch (action.type) { |
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 { useEffect, useState, useReducer } from 'react'; | |
import { isEmpty, isNil } from 'ramda'; | |
const isObjectLiked = (value) => | |
value.constructor.name == "Array" || | |
value.constructor.name == "Object"; | |
const rehydrate = (value, defaultValue) => { | |
if (!value) return defaultValue; | |
if (value === 'false') str = false; |
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 localforage from 'localforage'; | |
const useStorage = (state, setState) => { | |
const [rehydrated, setRehydrated] = useState(false); | |
const [error, setError] = useState(null); | |
useEffect(() => { | |
// Async rehydration | |
localforage.getItem(config.key, (err, value) => { | |
if (err) { |
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 SET_INFO = 'SET_INFO'; | |
const SET_ERROR = 'SET_ERROR'; | |
const initialState = { | |
info: {}, | |
error: null | |
}; | |
const reducer = (state, action) => { | |
switch (action.type) { |