Skip to content

Instantly share code, notes, and snippets.

View kevinyan815's full-sized avatar

Kevin Yan kevinyan815

View GitHub Profile
## docker login to platform other than dockerhub
docker login --username=hi31209766@aliyun.com registry.cn-hangzhou.aliyuncs.com
## dockcer build
docker build -t registry.cn-hangzhou.aliyuncs.com/docker-study-lab/continuous_profiling:v0.2 .
## docker push
docker push registry.cn-hangzhou.aliyuncs.com/docker-study-lab/continuous_profiling:v0.2
FROM php:7.1.22-fpm
# Update packages
RUN apt-get update
# Install PHP and composer dependencies
RUN apt-get install -qq git curl libmcrypt-dev libjpeg-dev libpng-dev libfreetype6-dev libbz2-dev
# Clear out the local repository of retrieved package files
RUN apt-get clean
<?php
class Jwt
{
/**
* Secret Key
*
* @var
*/
private $secret = '123';
sudo gitlab-ci-multi-runner register
function toBaseN(num, base) {
if (num === 0) {
return '0';
}
var digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var len = Math.min(digits.length, base);
var result = '';
while (num > 0) {
result = digits[num % len] + result;
num = parseInt(num / len, 10);
@kevinyan815
kevinyan815 / base62_convert.php
Last active October 14, 2018 09:25
base62_convert.php
/**
* Convert a numeric string from base 10 to another base.
*
* @param $value decimal string
* @param int $b base , max is 62
* @return string
*/
function to_base($value, $b = 62)
{
$base = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
@kevinyan815
kevinyan815 / .gitlab-ci.yml
Last active January 20, 2020 10:55
A full configured gitlab ci config demo
stages:
- build
- test
- deploy
before_script:
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > /root/.ssh/id_rsa
- chmod -R 600 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts #make sure remote servers's ssh host keys are verified
@kevinyan815
kevinyan815 / docker-compose.yml for laravel
Last active February 21, 2023 10:22
compose template for laravel docker project
version: '2'
services:
# The Application
app:
build:
context: ./
dockerfile: php-fpm.dockerfile
working_dir: /var/www
volumes:
- ./:/var/www