See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
<?php | |
// To create one CSV file: | |
// $ cat stats/stats-* > stats.csv | |
$query = array( | |
'browse' => 'popular', | |
'per_page' => 100, | |
'fields' => array( | |
'name' => true, |
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
This is not an exhaustive list of all interfaces in Go's standard library.
I only list those I think are important.
Interfaces defined in frequently used packages (like io
, fmt
) are included.
Interfaces that have significant importance are also included.
All of the following information is based on go version go1.8.3 darwin/amd64
.
# test_camera.py | |
# | |
# Open an RTSP stream and feed image frames to 'openalpr' | |
# for real-time license plate recognition. | |
import numpy as np | |
import cv2 | |
from openalpr import Alpr | |
package ciphers | |
import ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/sha512" | |
"crypto/x509" | |
"encoding/pem" | |
"log" | |
) |
package main | |
/** | |
Example hack to encrypt a file using a GPG encryption key. Works with GPG v2.x. | |
The encrypted file e.g. /tmp/data.txt.gpg can then be decrypted using the standard command | |
gpg /tmp/data.txt.gpg | |
Assumes you have **created** an encryption key and exported armored version. | |
You have to read the armored key directly as Go cannot read pubring.kbx (yet). |
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam' | |
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes' | |
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no' |
# I want to sync the local clock but don't have access to any NTP server. | |
# Website https://time.is tells me the time difference of my system clock and I can manually adjust the local clock. | |
# But then I recall that a HTTP response often contains a date header with current time in GMT timezone. | |
# I'll use it to set the system clock with the precision of 1 or 2 seconds. | |
# When I need more accurate time, I can use `datetime` (or `utc_datetime`) from `http://worldtimeapi.org/api/ip.txt` | |
# time from worldtimeapi.org has millisecond precision, you can use it to compare with your system time: | |
date -uIns && time curl -s http://worldtimeapi.org/api/ip.txt | sed -n 's/^utc_datetime://p' | |
date -Ins && time curl -s http://worldtimeapi.org/api/ip.txt | sed -n 's/^datetime://p' |
// A LRU "least recently used" cache | |
package lru | |
import ( | |
"container/list" | |
"fmt" | |
"sync" | |
) | |
// Cache represents a LRU consisting of a map as an index and a list to hold data and indicate the last recently used queue. |