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 ( | |
| "fmt" | |
| "github.com/gin-gonic/gin" | |
| "github.com/spf13/cast" | |
| ) | |
| type FilterBold struct { |
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
| version: "3.4" | |
| services: | |
| app: | |
| image: appimage/master:stable # change me | |
| ports: | |
| - 8081:80 | |
| env_file: | |
| - stage-prod.env | |
| environment: |
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
| ARG PHP_EXTENSIONS="apcu bcmath opcache pcntl pdo_mysql redis zip sockets imagick gd exif soap remoteip json" | |
| ARG APACHE_EXTENSIONS="remoteip" | |
| FROM thecodingmachine/php:7.4-v3-apache as php_base | |
| ENV TEMPLATE_PHP_INI=production | |
| ENV APACHE_EXTENSION_REMOTEIP=1 | |
| ENV PHP_EXTENSION_GD=1 | |
| ENV PHP_INI_MEMORY_LIMIT=1g | |
| ENV PHP_INI_MAX_EXECUTION_TIME=300 | |
| WORKDIR /var/www/html | |
| COPY --chown=docker:docker . . |
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
| // refrence http://www.aliarash.com/article/codemeli/codemeli.htm | |
| function checkNationalCode(code) { | |
| var L = code.length; | |
| if (L < 8 || parseInt(code, 10) == 0) return false; | |
| code = ('0000' + code).substr(L + 4 - 10); | |
| if (parseInt(code.substr(3, 6), 10) == 0) return false; | |
| var c = parseInt(code.substr(9, 1), 10); | |
| var s = 0; | |
| for (var i = 0; i < 9; i++) |
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 nightseas/ffmpeg:latest AS ffdocker | |
| FROM php:7.2-apache | |
| # copy libs from ffmpeg | |
| COPY --from=ffdocker /usr/local/bin/ffprobe /usr/local/bin/ffprobe | |
| COPY --from=ffdocker /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg | |
| COPY --from=ffdocker /usr/local/cuda-9.1 /usr/local/cuda-9.1 | |
| COPY --from=ffdocker /usr/local/bin/* /usr/local/bin/ | |
| COPY --from=ffdocker /usr/local/include/ffnvcodec /usr/local/include/ |
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 "reflect" | |
| func InjectStrcut(a interface{}, b interface{}) { | |
| v := reflect.ValueOf(a).Elem() | |
| targetName := reflect.TypeOf(b).Name() | |
| infector(v, b, targetName) | |
| } |
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
| git clone https://github.com/udhos/update-golang | |
| cd update-golang | |
| sudo ./update-golang.sh |
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 | |
| // for more information please look at: | |
| // https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis | |
| // https://www.reddit.com/r/golang/comments/6mtbx9/useful_constructors_in_go/ | |
| // OutputComponent struct | |
| type OutputComponent struct { | |
| Title string `json:"title,omitempty"` | |
| Icon string `json:"icon,omitempty"` |