Skip to content

Instantly share code, notes, and snippets.

@PattyAppier
PattyAppier / PattyScannerApp190220
Last active February 20, 2019 08:48
PattyScannerApp190220
// ViewController.swift
// PattyScanner
// Created by PattysiChip on 2019/2/20.
// Copyright © 2019 PattysiChip. All rights reserved.
import UIKit
import AVFoundation
import CoreGraphics
// AVCaptutureMetadataOutput 是 Read barcode 的核心,能夠 intercept 攔截來自輸入裝置的原資料。
// ViewController.swift
// PattyScanner
// Created by PattysiChip on 2019/2/20.
// Copyright © 2019 PattysiChip. All rights reserved.
import UIKit
import AVFoundation
import CoreGraphics
// AVCaptutureMetadataOutput 是 Read barcode 的核心,能夠 intercept 攔截來自輸入裝置的原資料。
// 此協定能讓元資料被擷取時,將其轉給代理 self 操作。
// ViewController.swift
// PattyScanner
// Created by PattysiChip on 2019/2/20.
// Copyright © 2019 PattysiChip. All rights reserved.
import UIKit
import AVFoundation
import CoreGraphics
// AVCaptutureMetadataOutput 是 Read barcode 的核心,能夠 intercept 攔截來自輸入裝置的原資料。
// 此協定能讓元資料被擷取時,將其轉給代理 self 操作。
@PattyAppier
PattyAppier / Build.Gradle.txt
Last active October 10, 2018 07:30
GoogleMobileVision-BarcodeDetector
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.pattyappier.pattyluvapp.no5robot"
minSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
@PattyAppier
PattyAppier / QRcodersMainSourceCode.java
Created October 5, 2018 10:04
QR coder (Google Vision API)
package com.pattyappier.pattyluvapp.pattysqrcoder.feature;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.util.SparseArray;
@PattyAppier
PattyAppier / FirPy.py
Last active December 7, 2019 08:29
PattysGooPy.proj_2018_601
import pyrebase
import GooPy
import pyrebase
config = {
"apiKey": "AIzaSyClr4KhSkUVy0kMipcXCYMCMpDCFgBEXKY",
"authDomain": "pattys-goopy-1527579295440.firebaseapp.com",
"databaseURL": "https://pattys-goopy-1527579295440.firebaseio.com",
@PattyAppier
PattyAppier / 1_Ref&Query.py
Last active May 30, 2018 08:08
Firebase_DB_codeScript.File_2018-0530
var var1 = false #Boolean Type
fun() {
var1 = false
Database.database()
.reference()
.child("Requests Name")
.queryOrdered(byChild:"value1 name")
.queryEqual(toValue: "alue1 name")
@PattyAppier
PattyAppier / GooPy.py
Created May 29, 2018 10:45
PattysGooPy_2018_0529
import urllib.request
import json
import ssl
import googleapiclient
endpoint = 'https://maps.googleapis.com/maps/api/distancematrix/json?'
ssl._create_default_https_context = ssl._create_unverified_context
api_key = 'AIzaSyC14nJwhxNKsRtDWZNZzM_vCu0D4imEwBs'
@PattyAppier
PattyAppier / app.py
Last active May 25, 2018 13:20
ExchangeRate_Python
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Wish Luck is with you today!"
#if _name_ == "_main_":
#app.run()
@PattyAppier
PattyAppier / MapsActivity.kt
Created May 22, 2018 14:36
PattysPockemonApp(AndroidStudio.Kotlin)
package com.example.pattychen.pattyspockemon
import android.content.Context
import android.content.pm.PackageManager
import android.location.Location
import android.location.LocationListener
import android.location.LocationManager
import android.os.Build
import android.support.v4.app.FragmentActivity
import android.os.Bundle