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
@app.route('/images') | |
def show_images(): | |
return render_template('images.html', images=os.listdir('static/images')) |
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
<!DOCTYPE=html> | |
<html> | |
<body> | |
{% for img in images %} | |
<h1 > {{img}} </h1> | |
<img src="images/{{img}}" alt="{{img}}"> | |
{% endfor %} | |
</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
func setupSystray() { | |
data, err := Asset("images/bitmap.ico") | |
if err != nil { | |
fmt.Println("Icon reading error", err) | |
return | |
} | |
systray.SetTemplateIcon(data, data) | |
systray.SetTitle("Insert Date") |
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
package main | |
import ( | |
"log" | |
"syscall" | |
"unsafe" | |
) | |
type keyboardInput struct { | |
wVk uint16 |
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
package main | |
// Keycodes maps keys to their respective virtual key code from https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes | |
var Keycodes = map[string]uint16{ | |
" ": 0x20, | |
"-": 0xBD, | |
"0": 0x30, | |
"1": 0x31, | |
"2": 0x32, | |
"3": 0x33, |
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
// MSG see https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-msg | |
type MSG struct { | |
HWND uintptr | |
UINT uintptr | |
WPARAM int16 | |
LPARAM int64 | |
DWORD int32 | |
POINT struct{ X, Y int64 } | |
} |
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
import ( | |
"bytes" | |
"fmt" | |
"strings" | |
"syscall" | |
"time" | |
"unsafe" | |
) | |
func main() { |
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
// HOTKEYS to listen to | |
var HOTKEYS = map[int16]*Hotkey{ | |
1: &Hotkey{4, ModAlt + ModCtrl, 'D'}, | |
} | |
const ( | |
ModAlt = 1 << iota | |
ModCtrl | |
ModShift | |
ModWin |
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
import numpy as np | |
import cv2 | |
# frame dimensions should be square | |
PREPROCESS_DIMS = (300, 300) | |
def read_labels(label_map_path = 'models/labelmap.prototxt'): | |
CLASSES = [] | |
with open(label_map_path) as f: | |
lines = f.readlines() |
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
#!/bin/bash | |
export FLASK_APP=server.py | |
python3 -m flask run |