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
## builder docker | |
FROM golang:1.9.2 as builder | |
WORKDIR /go/src/buddytest | |
copy ./ . | |
RUN curl https://glide.sh/get | sh | |
RUN glide install | |
RUN go test | |
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app . |
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 php:7 | |
RUN apt-get update -y && \ | |
apt-get install -y \ | |
openssl zip unzip git php7.0-mysql \ | |
php7.0-cli php7.0-common \ | |
mysql-client | |
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer |
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 ( | |
"encoding/json" | |
"fmt" | |
"os" | |
) | |
func main() { | |
decoder := json.NewDecoder(os.Stdin) |
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" | |
"regexp" | |
) | |
const ( | |
regexIPv4 = `(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})` | |
regexIPv6 = `((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4}))*::((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4}))*|((?:[0-9A-Fa-f]{1,4}))((?::[0-9A-Fa-f]{1,4})){7}` |
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
#### install docker on ubuntu 16.04 or newer #### | |
# update repository | |
sudo apt update | |
# Install packages to allow apt to use a repository over HTTPS: | |
sudo apt install \ | |
apt-transport-https \ | |
ca-certificates \ |
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
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### # | |
# | |
# _dockerfile/mysql/conf.d/my.cnf | |
# Last update: 2017-01-05_10h05 | |
# | |
# This mysql config is made to run within the official mysql container. | |
# https://hub.docker.com/_/mysql/ | |
# | |
# Inspired by: | |
# https://www.percona.com/blog/2016/10/12/mysql-5-7-performance-tuning-immediately-after-installation/ |
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
# app/models/image.rb | |
class Image < ActiveRecord::Base | |
has_many :taggings, :as => :taggable | |
has_many :tags, :through => :taggings | |
end |
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" | |
"reflect" | |
) | |
func main() { | |
items := []int{1,2,3,4,5,6} | |
fmt.Println(SliceExists(items, 5)) // returns true |
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
ffmpeg -i input.flv -vf fps=1 out%04d.png | |
# fps=1 (1 image per second) | |
# fps=2 (2 image per second) | |
# fps=1/60 (1 image per minute) | |
# fps=1/600 (1 image per 10 minutes) |
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
ffmpeg -r 10 -f image2 -s 1920x1080 -i %04d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p test.mp4 | |
# -r is the framerate (fps) | |
# -i %04d.png (example 0001.png, 0002.png) | |
# -crf is the quality, lower means better quality, 15-25 is usually good | |
# -s is the resolution | |
# -pix_fmt yuv420p specifies the pixel format, change this as needed |