-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 88e893a
Showing
23 changed files
with
3,777 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
|
||
# Silly Macs | ||
*.DS_Store | ||
|
||
# Scratch | ||
scratch.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Memair | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Memair Desktop App | ||
|
||
## Development | ||
|
||
Install Electron: `npm install --save-dev electron` | ||
|
||
Install packager: `npm install electron-packager -g` | ||
|
||
Build package | ||
|
||
- Mac Example | ||
|
||
`electron-packager ./ Memair --platform=darwin --arch=x64 --icon=assets/icons/mac/memair.icns --overwrite` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const sqlite3 = require('sqlite3'); | ||
const db_location = 'db/memair.db' | ||
|
||
const fs = require('fs'); | ||
const path = require('path'); | ||
const json = require('big-json'); | ||
|
||
|
||
const google_location_history = 'tmp/Takeout/Location History/Location History.json' | ||
|
||
function sleep(delay) { | ||
var start = new Date().getTime(); | ||
while (new Date().getTime() < start + delay); | ||
} | ||
|
||
function build_locations_table() { | ||
var db = new sqlite3.Database(db_location); | ||
console.log('building locations table'); | ||
db.run(` | ||
CREATE TABLE IF NOT EXISTS locations( | ||
latitude FLOAT NOT NULL, | ||
longitude FLOAT NOT NULL, | ||
accuracy FLOAT, | ||
timestamp DATETIME NOT NULL | ||
);` | ||
) | ||
db.close() | ||
} | ||
|
||
function addLocation(db, raw_location) { | ||
var moment = require('moment'); | ||
var timestamp = moment.unix(raw_location['timestampMs']/1000).format('YYYY-MM-DD hh:mm:ss.ss') | ||
var latitude = raw_location['latitudeE7'] / 1e7 | ||
var longitude = raw_location['longitudeE7'] / 1e7 | ||
var accuracy = raw_location['accuracy'] | ||
db.run(` | ||
INSERT INTO locations ( | ||
latitude, | ||
longitude, | ||
accuracy, | ||
timestamp | ||
) VALUES ( | ||
${latitude}, | ||
${longitude}, | ||
${(accuracy == undefined) ? 'NULL' : accuracy}, | ||
'${timestamp}' | ||
); | ||
`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset = "UTF-8"> | ||
<title>Memair Player</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta name="author" content="Greg Clarke"> | ||
<style> | ||
html, body { | ||
width: 100%; | ||
height: 100%; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div style="width:100%; height:100%"> | ||
<webview id="player" autosize="on" src="https://memair.com/player?desktop_app=true" style="min-width:100%; min-height:100%"> | ||
<div class="indicator"></div> | ||
</webview> | ||
</div> | ||
|
||
<script type = "text/javascript"> | ||
// Event handlers for loading events. | ||
// Use these to handle loading screens, transitions, etc | ||
onload = () => { | ||
const webview = document.getElementById('player') | ||
const indicator = document.querySelector('.indicator') | ||
|
||
const loadstart = () => { | ||
indicator.innerText = 'loading...' | ||
} | ||
|
||
const loadstop = () => { | ||
indicator.innerText = '' | ||
} | ||
|
||
webview.addEventListener('did-start-loading', loadstart) | ||
webview.addEventListener('did-stop-loading', loadstop) | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict' | ||
|
||
window.$ = window.jQuery = require('jquery') | ||
window.Tether = require('tether') | ||
window.Bootstrap = require('bootstrap') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
How to use this icon: | ||
|
||
Step 1: Copy the icon to the clipboard | ||
a) Click on this file from the Finder | ||
b) Choose 'Get Info' from the 'File' menu. | ||
c) In the info window that pops up, click on the icon | ||
d) Choose 'Copy' from the 'Edit' menu. | ||
e) Close the info window | ||
|
||
Step 2: Paste the icon to the desired item | ||
a) Go to the item in the Finder that you want a custom icon | ||
b) Click the item (file, folder, disk, etc) | ||
b) Choose 'Get Info' from the 'File' menu. | ||
c) In the info window that pops up, click on the icon | ||
d) Choose 'Paste' from the 'Edit' menu. | ||
e) Close the info window | ||
|
||
Step 3: | ||
Enjoy your newly customized icon! | ||
|
||
For more thorough directions, see Apple's website at: | ||
http://www.apple.com/support/mac101/customize/6/ |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except this file | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { app, BrowserWindow, Menu } = require('electron') | ||
var path = require('path') | ||
|
||
function createWindow () { | ||
win = new BrowserWindow({ | ||
width: 1000, | ||
height: 800, | ||
icon: path.join(__dirname, 'assets/icons/png/64x64.png') | ||
}) | ||
|
||
win.loadFile('app/index.html') | ||
|
||
Menu.setApplicationMenu(); | ||
} | ||
|
||
app.on('ready', createWindow) |
Oops, something went wrong.