Skip to content

Instantly share code, notes, and snippets.

Avatar

Evan Halley evanhalley

View GitHub Profile
@evanhalley
evanhalley / gulpfile.js
Created Mar 24, 2020
Small example of using the very basics of gulp.
View gulpfile.js
const { series, src, dest } = require('gulp');
const tap = require('gulp-tap');
function helloWorld(cb) {
console.log('hello world');
cb();
}
function helloWorldPromise() {
return new Promise((resolve, reject) => {
@evanhalley
evanhalley / gulpfile.js
Created Mar 24, 2020
Small example of using the very basics of gulp.
View gulpfile.js
const { series, src, dest } = require('gulp');
const tap = require('gulp-tap');
function helloWorld(cb) {
console.log('hello world');
cb();
}
function helloWorldPromise() {
return new Promise((resolve, reject) => {
@evanhalley
evanhalley / build_deploy.yml
Created Jan 26, 2020
Building and deploying a Hugo generated static HTML site to Firebase hosting.
View build_deploy.yml
name: Build & deploy
on:
push:
branches:
- master
jobs:
build:
@evanhalley
evanhalley / TodoistCompletedTasksReport.gs
Created Aug 9, 2019
Google Script that uses the Todoist API to retrieve completed tasks, then builds and emails a report.
View TodoistCompletedTasksReport.gs
var COMPLETED_TASKS_ENDPOINT = 'https://api.todoist.com/sync/v8/completed/get_all?since=[SINCE]&until=[UNTIL]';
var EMAIL_SUBJECT = 'Todoist Completed Tasks Report for [DATE]';
var MILLIS_PER_DAY = 1000 * 60 * 60 * 24;
function main() {
var yesterday = getYesterday();
var tasks = getCompletedTasks(yesterday);
if (tasks) {
processCompletedTasks(tasks, yesterday);
View MainActivity.kt
package com.emuneee.tensorandflow
import android.graphics.*
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_main.*
import android.graphics.Bitmap
import com.emuneee.tensorandflow.classifier.Classifier
import com.emuneee.tensorandflow.classifier.TFMobileClassifier
import com.emuneee.tensorandflow.view.CanvasView
View data.json
[{
"filename": "1495332407.63.jpg",
"is_congested": -1
}, {
"filename": "1495332973.66.jpg",
"is_congested": -1
}, {
"filename": "1495333131.12.jpg",
"is_congested": -1
}, {
@evanhalley
evanhalley / generate_list.py
Created Jun 7, 2017
Reads a list of images in a directory then builds a JSON object representation with some additional metadata
View generate_list.py
from os import listdir
import json
files = listdir('./traffic_images')
data = []
# loop over the list of files and write it to an array
for image_file in files:
row = {}
row['filename'] = image_file
@evanhalley
evanhalley / save_image.py
Last active May 21, 2017
Saves an image (jpg) given a url
View save_image.py
import sys
import urllib
import time
url = sys.argv[1]
directory = sys.argv[2]
destination = directory + "/" + str(time.time()) + ".jpg"
print 'Saving image from url ', url, ' to ', destination
urllib.urlretrieve(url, destination)
@evanhalley
evanhalley / MainActivity.java
Created Feb 15, 2017
Implementing logic to listen for proximity echos in Android Things
View MainActivity.java
package com.emuneee.parkright;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import com.google.android.things.pio.Gpio;
import com.google.android.things.pio.GpioCallback;
import com.google.android.things.pio.PeripheralManagerService;
You can’t perform that action at this time.