Skip to content

Instantly share code, notes, and snippets.

View kanzitelli's full-sized avatar
💭
I may be slow to respond.

Batyr kanzitelli

💭
I may be slow to respond.
View GitHub Profile
@kanzitelli
kanzitelli / secret_mag.go
Created September 7, 2019 22:07
SecretMag crawler. #1
package crawler
import (
"fmt"
"time"
"github.com/gocolly/colly"
)
// SecretMag <struct>
@kanzitelli
kanzitelli / News.go
Last active September 7, 2019 20:13
Models. #1
package models
// News <model>
// is used to describe article model.
type News struct {
ID string `json:"_id" bson:"_id"`
Title string `json:"title" bson:"title"`
Preamble string `json:"preamble" bson:"preamble"`
TimeAdded int64 `json:"time_added" bson:"time_added"`
Link string `json:"link" bson:"link"`
package main
import (
)
func main() {
server.Init()
}
@kanzitelli
kanzitelli / crawler.go
Last active September 6, 2019 17:05
crawler/crawler.go #1
package crawler
import (
"time"
)
// NewsCrawler <interface>
// is used to describe news crawler class instance
type NewsCrawler interface {
Run() []models.News
@kanzitelli
kanzitelli / news.go
Created August 28, 2019 16:08
controllers/news.go #1
package controllers
import (
"github.com/gin-gonic/gin"
)
// NewsController <controller>
// is used for describing controller actions for news.
type NewsController struct{}
@kanzitelli
kanzitelli / routes.go
Last active September 6, 2019 17:04
server/routers.go #1
package server
import (
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
)
// NewRouter <function>
// is used to create a GIN engine instance where all controller and routes will be placed
func NewRouter() *gin.Engine {
@kanzitelli
kanzitelli / server.go
Last active September 6, 2019 17:04
server/server.go #1
package server
import (
)
// Init <function>
// is used to initialize server and all the corresponding services such as DB, Utils, Workers
func Init() {
// utils
@kanzitelli
kanzitelli / utils.go
Last active August 28, 2019 15:32
utils/utils.go #1 - 📰Good News app. Golang backend behind Traefik reverse proxy with https available.
package utils
import (
"log"
"github.com/kelseyhightower/envconfig"
)
// EnvVariables <struct>
// is used to descrive environment variables structure of a project
@kanzitelli
kanzitelli / main.go
Created August 28, 2019 14:04
#1. 📰Good News app. Golang backend behind Traefik reverse proxy with https available.
package main
import (
"fmt"
)
func main() {
fmt.Println("Good news!")
}
@kanzitelli
kanzitelli / kanzitelli.react-native-navigation-mobx-boilerplate + Apollo2
Last active May 5, 2018 19:01
React Native Navigation Mobx Boilerplate + Apollo2
// Thanks to github/@megahertz - https://gist.github.com/megahertz/3aad3adafa0f7d212b81f5e371863637
import { Children } from "react"
import { Provider } from 'mobx-react/native';
import { ApolloProvider } from 'react-apollo';
const SPECIAL_REACT_KEYS = { children: true, key: true, ref: true };
export default class MobxRnnProvider extends Provider {
props: {