Skip to content

Instantly share code, notes, and snippets.

View sysatom's full-sized avatar
🎯
Focusing

Robin sysatom

🎯
Focusing
View GitHub Profile
# stop
docker stop $(docker ps -a | grep "Exited" | awk '{print $1 }')
# remove
docker rm $(docker ps -a | grep "Exited" | awk '{print $1 }')
# remove
docker rmi $(docker images | grep "none" | awk '{print $3}')
@sysatom
sysatom / Dockerfile
Created April 24, 2019 08:17
php-fpm of laravel
FROM php:7.1-fpm
# Set working directory
WORKDIR /var/www
# Install dependencies
RUN apt-get update && apt-get install -y \
libgmp-dev \
re2c \
libmhash-dev \
@sysatom
sysatom / Dockerfile
Created April 24, 2019 08:15
Dockerfile of Laravel
FROM php:7.1-alpine
# Install dev dependencies
RUN apk add --no-cache --virtual .build-deps \
$PHPIZE_DEPS \
curl-dev \
imagemagick-dev \
libtool \
libxml2-dev \
postgresql-dev \
version: '3.1'
services:
mongo:
image: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: 123456
@sysatom
sysatom / demo.sql
Created September 13, 2016 06:32
Finding out largest tables on MySQL Server
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10;
import UIKit
import AVFoundation
class QRScanViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate {
var captureSession: AVCaptureSession?
var videoPreviewLayer: AVCaptureVideoPreviewLayer?
var qrCodeFrameView: UIView?
// Added to support different barcodes
@sysatom
sysatom / imageHash.py
Created December 2, 2015 06:34
image hash
#!/usr/bin/python
import glob
import os
import sys
from PIL import Image
EXTS = 'jpg', 'jpeg', 'JPG', 'JPEG', 'gif', 'GIF', 'png', 'PNG'
@sysatom
sysatom / hamming.py
Created December 2, 2015 06:32
hamming
#encoding:utf-8
import Image
img = 'c5c07bd19d6a01def7a8920a805b5376_m.jpg'
im = Image.open(img)
im = im.resize((8, 8), Image.ANTIALIAS).convert('L')
print im.getdata()
import sys
import subprocess
from urlparse import urlparse, parse_qs
def main(script, plate):
url = urlparse(plate)
query_string = parse_qs(url.query)
application = r'D:\Program Files\HeidiSQL\heidisql.exe'
command = [application,
@sysatom
sysatom / tma.go
Created November 8, 2014 10:48
Tweetable Mathematical Art
package main
import (
"fmt"
"os"
)
const (
DIM = 1024
DM1 = DIM - 1