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 os | |
import re | |
import tkinter as tk | |
from tkinter import filedialog | |
from datetime import datetime | |
def get_all_files_with_ext(path, ext): | |
files_with_ext = [] | |
for root, dirs, files in os.walk(path): | |
for file in files: |
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
readURL = (input, template, id) -> | |
filesToUpload = input.files | |
file = filesToUpload[0] | |
# Create an image | |
img = document.createElement('img') | |
# Create a file reader | |
reader = new FileReader | |
# Set the image once loaded into file reader | |
reader.onload = (e) -> |
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
#When using UI Hooks, the docs will tell you to do it like this: | |
#This is wrong, but will work unless you are doing something that involves positioning. Namely autoscrolling behavior. | |
@find('#container')._uihooks = { | |
insertElement: -> | |
$(node).insertBefore(next) | |
#I researched how MDG does inserts themselves. They do it more like this: | |
#This works without an issue if you've implemented autoscrolling on this collection via template-level subscriptions. | |
#This is because this uses DOM insert rather than JQuery. | |
#It also, unfortunately, requires an additional piece of information - though one you likely already have! $('#container') | |
$('#container')[0].insertBefore(node, next) |
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
//Exhibit 1: They're the same | |
Template.notifications.helpers({ | |
notifications: function(){ | |
return Notifications.find({userId: Meteor.userId(), read: false}); | |
}, | |
notificationCount: function(){ | |
return Notifications.find({userId: Meteor.userId(), read: false}).count(); | |
} | |
}); |