Skip to content

Instantly share code, notes, and snippets.

Tony Hung tbass134

  • New York
Block or report user

Report or block tbass134

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import requests
import datetime
from datetime import timedelta
import json
tbass134 /
Last active Jun 2, 2020
Delete VBC Recordings
# -*- coding: utf-8 -*-
"""VBC - Extensions.ipynb
Automatically generated by Colaboratory.
Original file is located at
import sys
import os
import shutil
import time
import traceback
import requests
import numpy as np
from flask import Flask, request, jsonify
tbass134 /
Last active Sep 8, 2018
Download Transcriptions from Youtube playlist
import requests
import json
import pandas as pd
from import json_normalize #package for flattening json in pandas df
from xml.etree import ElementTree
from import json_normalize
import sys
YT_API_KEY = '{youtube_api_key}'
playlist_id = '{playlist_id}'
tbass134 / getInfo.js
Last active May 25, 2019
Dialogflow webhook to transfer user to live agent
View getInfo.js
function getInfo(contexts) {
var product = contexts[contexts.length - 1]['parameters']['Product']
var state = contexts[contexts.length - 1]['parameters']['geo-state-us']
for (var i = 0; i < contexts.length; i++) {
var context = contexts[i]['parameters']
if (typeof context['Product'] != "undefined" && typeof context['geo-state-us'] != "undefined") {
return context
View one-hot.swift
func toOneHot(_ string:String) -> [Double] {
var str = string
var items = [Double](repeating: 0.0, count: 7)
let weather_conds:[String] = ["Clear", "Clouds", "Fog", "Haze", "Rain", "Smoke", "Snow"]
if str.lowercased().range(of:"cloud") != nil || str.lowercased().range(of:"overcast") != nil{
str = "Clouds"
if str.lowercased().range(of:"snow") != nil {
View gist:599031e6525473e2f02fd66a174fb3ec
let input = coffee_predictionInput(input: mlMultiArray)
guard let prediction = try? model.prediction(input: input) else {
let result = prediction
print("classLabel \(result.classLabel)")
if result.classLabel == 1 {
self.class_image.image = UIImage.init(named: "coffee_hot")
You can’t perform that action at this time.