Skip to content

Instantly share code, notes, and snippets.

Avatar

Evan E. Huang huangenyan

View GitHub Profile
View UIImageExtension.swift
import UIKit
extension UIImage {
func resizeImage(size: CGSize) -> UIImage? {
UIGraphicsBeginImageContextWithOptions(size, true, 1)
self.draw(in: CGRect(origin: CGPoint.zero, size: size))
let resizedImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return resizedImage
View Robo Advisor Patch API.md

API URL: https://ra.apptech.com.hk/api/engine/companies/:company-id

Method: PATCH

parameters: company-id: The company ID specified in the email.

body

format: application/json
structure
{
  (optional)"news": [
    {
@huangenyan
huangenyan / takephoto.py
Created Dec 21, 2016
Take photo using OpenCV
View takephoto.py
import cv2
import sys
path = sys.argv[1]
if len(sys.argv) != 2:
print "Usage: %s <image_save_path>" % sys.argv[0]
cap = cv2.VideoCapture(0)
count = 0
You can’t perform that action at this time.