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
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
# 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
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### # | |
# | |
# _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
#### 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
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
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
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
## 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 debian:jessie | |
MAINTAINER Reza Morsali | |
# install dependencies | |
RUN apt-get update && apt-get install -y wget git autoconf build-essential gettext libgettextpo-dev libgeoip-dev libncursesw5-dev pkg-config libglib2.0 && git clone https://github.com/allinurl/goaccess.git && cd goaccess && autoreconf -fiv && ./configure --enable-geoip --enable-utf8 && make && make install && apt-get purge -y wget git autoconf build-essential libncursesw5-dev pkg-config && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* && cd .. && rm -rf goaccess | |
RUN mkdir -p /home/root/www | |
RUN touch /home/root/www/report.html |