Skip to content

Instantly share code, notes, and snippets.

Elvis Sun elvisun

Block or report user

Report or block elvisun

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
View take_pictures.sh
#!/bin/bash
DATE=$(date +"%Y-%m-%d_%H%M%S")
fswebcam -S 30 -r 480x240 --no-banner /home/pi/Pictures/data-collection/$DATE.jpg
View app.py
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 Apr 6, 2020
Upload pictures taken to a Google Cloud Storage bucket
View upload_to_gcs
*/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
View Survivor.js
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;
View sample.vbs
' some sample code
You can’t perform that action at this time.