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
| # -*- coding: utf-8 -*- | |
| ###################### Параметры ######################### | |
| PETITION_ID = 73080 | |
| REQ_NAME = u'Овечко' | |
| START_PAGE = 1 | |
| END_PAGE = 10**100 |
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
| # create/update resources | |
| kubectl --context=minikube apply -f ./postgres.yaml | |
| # In order for the service to reach the statefulset, the following should | |
| # be true: | |
| # statefulset.spec.selector.matchLabels.app == service.spec.selector.app | |
| # statefulset.spec.selector.matchLabels.role == service.spec.selector.role | |
| # give the server some time to start up | |
| # ... |
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
| cmake_minimum_required(VERSION 3.7) | |
| project(fridge) | |
| set(CMAKE_CXX_STANDARD 11) | |
| file(GLOB SRC_FILES ${PROJECT_SOURCE_DIR}/src/* ${PROJECT_SOURCE_DIR}/src/*/* ${PROJECT_SOURCE_DIR}/src/*/*/*) | |
| if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | |
| # filter mac os source files | |
| list(FILTER SRC_FILES EXCLUDE REGEX ".*mm$") |
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
| #!/usr/bin/env python | |
| # Based on https://www.openwall.com/lists/oss-security/2018/08/16/1 | |
| # untested CVE-2018-10933 | |
| import sys, paramiko | |
| import logging | |
| username = sys.argv[1] | |
| hostname = sys.argv[2] | |
| command = sys.argv[3] |
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
| import os, argparse | |
| import tensorflow as tf | |
| from tensorflow.python.tools import freeze_graph as freeze_tool | |
| def freeze_graph(sess, input_checkpoint_path): | |
| saver = tf.train.Saver() # or your own Saver | |
| saver.restore(sess, input_checkpoint_path) | |
| absolute_model_dir = 'absolute_model_dir1111' | |
| graph_file_name = 'tf-model_graph' |
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
| // MARK : Localization+IBInspectable.h | |
| @interface UILabel(Localization) | |
| @property (nonatomic, weak) IBInspectable NSString *localizationId; | |
| @end | |
| @interface UIButton(Localization) | |
| @property (nonatomic, weak) IBInspectable NSString *localizationId; | |
| @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
| import cv2 | |
| import numpy as np | |
| from skimage.measure import compare_ssim as ssim | |
| def mse(imageA, imageB): | |
| # the 'Mean Squared Error' between the two images is the | |
| # sum of the squared difference between the two images; | |
| # NOTE: the two images must have the same dimension | |
| err = np.sum((imageA.astype("float") - imageB.astype("float")) ** 2) | |
| err /= float(imageA.shape[0] * imageA.shape[1]) |
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
| // swift 3 | |
| import UIKit | |
| import AVFoundation | |
| class VideoPreviewView: UIView { | |
| private var videoOutput: AVCaptureMovieFileOutput? | |
| private var captureSession: AVCaptureSession? | |
| private var previewLayer: AVCaptureVideoPreviewLayer? | |