Skip to content

Instantly share code, notes, and snippets.

View dmitrymomot's full-sized avatar
🤨

Dmytro Momot dmitrymomot

🤨
View GitHub Profile
@dmitrymomot
dmitrymomot / nginx.conf
Created June 5, 2018 10:03 — forked from mreschke/nginx.conf
Nginx config for multiple laravel sites based on /api/v1 url paths
# This config will host your main [Laravel] GUI application at /, and any additional [Lumen] webservices at /api/v1 and /api/v2...
# This also works perfectly for all static file content in all projects
# This is full of debug comments so you can see how to print debug output to browser! Took me hours to nail this perfect config.
# Example:
# http://example.com - Main Laravel site as usual
# http://example.com/about - Main Laravel site about page as usual
# http://example.com/robots.txt - Main Laravel site static content as usual
# http://example.com/api/v1 - Lumen v1 api default / route
# http://example.com/api/v1/ - Lumen v1 api default / route
@dmitrymomot
dmitrymomot / ObserverDesignPattern.go
Created May 15, 2018 23:05 — forked from sayden/ObserverDesignPattern.go
Observer Pattern in Golang
package main
import "fmt"
//Listener is a
type Listener struct {
ID int
}
//ListenerInterface is an
@dmitrymomot
dmitrymomot / capitalize_first_char.go
Last active April 5, 2018 08:27
Capitalize the first char of a string
package helper
import (
"fmt"
"unicode"
)
func CapitalizeFirstChar(s string) string {
a := []rune(s)
a[0] = unicode.ToUpper(a[0])
@dmitrymomot
dmitrymomot / nuxtjs-docker-compose.yml
Created March 6, 2018 00:58
docker-compose file for nuxtjs application
app:
image: node:latest
command: "npm run dev"
environment:
HOST: 0.0.0.0
PORT: 3000
volumes:
- .:/app
- ./_logs/:/root/.npm/_logs/
working_dir: /app
@dmitrymomot
dmitrymomot / gin-miniapi.go
Created March 5, 2018 11:23 — forked from AaronGhent/gin-miniapi.go
golang gin - mini rest api jwt + proxy
package main
## Install
# sudo apt install golang-go
# echo GOPATH=`pwd`
# export GOPATH=`pwd`
# go get -u -v github.com/appleboy/gin-jwt
# go get -u -v github.com/gin-contrib/cors
# go get -u -v github.com/gin-gonic/gin
# go get -u -v github.com/derekparker/delve/cmd/dlv
@dmitrymomot
dmitrymomot / README.md
Created March 4, 2018 00:49 — forked from mrkpatchaa/README.md
Bulk delete github repos

Use this trick to bulk delete your old repos or old forks

(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)

  1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories

  2. Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.

  3. Save that list to some path

  4. The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.

@dmitrymomot
dmitrymomot / mysql-cheatsheet.md
Last active March 1, 2018 17:15 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
package main
import (
"encoding/json"
"fmt"
// init mysql
_ "github.com/go-sql-driver/mysql"
"github.com/jinzhu/gorm"
@dmitrymomot
dmitrymomot / client.go
Created February 24, 2018 16:52 — forked from jordanorelli/client.go
rpc server example in go
package main
import (
"bufio"
"log"
"net/rpc"
"os"
)
func main() {
@dmitrymomot
dmitrymomot / main.go
Created January 9, 2018 20:45 — forked from ivanmrchk/main.go
Sending email template with golang using gomail v2 and attaching files.
package main
import (
"bytes"
"html/template"
"log"
gomail "gopkg.in/gomail.v2"
)