Skip to content

Instantly share code, notes, and snippets.

View elvisun's full-sized avatar

Elvis Sun elvisun

View GitHub Profile
Launching lib/main.dart on iPhone SE (2nd generation) in debug mode...
Warning: Missing build name (CFBundleShortVersionString).
Warning: Missing build number (CFBundleVersion).
Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store.
Running Xcode build...
Xcode build done. 6.9s
Failed to build iOS app
Error output from Xcode build:
** BUILD FAILED **
#!/bin/bash
DATE=$(date +"%Y-%m-%d_%H%M%S")
fswebcam -S 30 -r 480x240 --no-banner /home/pi/Pictures/data-collection/$DATE.jpg
import numpy as np
import tensorflow as tf
import time
from sms import send_message
def run_prediction():
fileContent = tf.io.read_file('live.jpg', name="loadFile")
image = tf.image.decode_jpeg(fileContent, name="decodeJpeg")
@elvisun
elvisun / upload_to_gcs
Last active April 6, 2020 18:15
Upload pictures taken to a Google Cloud Storage bucket
*/5 * * * * ~/Documents/github/garage-monitoring/data-collection/take_picture.sh 2>&1
*/30 * * * * gsutil -m cp -r /home/pi/Pictures/data-collection/ gs://garage-door-training-data
@elvisun
elvisun / Survivor.js
Last active September 18, 2019 19:20
function kill(people) {
const survivors = [];
for(let i =0; i < people.length; i++) {
if (i % 2 === 0) { // index start from 0, so odd is even
console.log("a person is killed");
// then do nothing
}
else {
survivors.push(people[i]);
// Or add to new line;
@elvisun
elvisun / sample.vbs
Created November 16, 2016 20:18
VBA project
' some sample code