Skip to content

Instantly share code, notes, and snippets.

View dtzitz's full-sized avatar

Dylan Zitzmann dtzitz

View GitHub Profile
averagescore: function(){
scores = Scores.find({kid : this._id},{sort: {point_date:-1} })
//iterate over the score/date hash to implement date logic
i = 0
points_total = 0
scores.forEach(function (scores) {
// ...
i++
eval_date = moment(scores.point_date, "MM DD YYYY")
end_of_week = moment().isoWeekday(6)
if (Meteor.isClient){
console.log("subscribing to orgs")
Meteor.subscribe("orgs")
}
Template.organizations.events({
'submit #newOrg':function(event){
orgName = event.target.inputOrgName.value
orgAddress = event.target.inputAddress.value
orgSecAddress = event.target.inputSAddress.value
Meteor.methods({
addOrganization: function(orgName,orgAddress,orgSecAddress,orgPOCemail){
var loggedInUser = Meteor.user()
if (loggedInUser || Roles.userIsInRole(loggedInUser,['Admin'])){
Orgs.insert({
orgName:orgName,
@dtzitz
dtzitz / cart.exs
Last active August 30, 2016 21:56
# from ounce of elixir
#https://www.meetup.com/Women-Who-Code-Tampa/events/233014583/
ExUnit.start
defmodule CartTest do
use ExUnit.Case
test "starts with empty count" do
assert Cart.count_items([]) == 0
~ $ python manage.py makemigrations
Did you rename event.event_end_date to event.end_date (a DateTimeField)? [y/N] y
Did you rename event.event_start_date to event.start_date (a DateTimeField)? [y/N] y
Did you rename event.event_title to event.title (a CharField)? [y/N] y
Migrations for 'events':
events/migrations/0002_auto_20170721_1815.py
- Rename field event_end_date on event to end_date
- Rename field event_start_date on event to start_date
- Rename field event_title on event to title
- Add field category to event
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel.Background;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
@dtzitz
dtzitz / watchcopy.ps1
Created September 20, 2018 02:37
powershell script to watch a directory and copy any file that shows up in it
#
# Script.ps1
#
$folder = 'C:\dev\copy' # <-- change this to the directory that will be watched
$filter = '*.*' # <-- set this according to your requirements
$destination = 'C:\dev\paste' # <-- change this to the directory that will hold a copy of the file(s)
$fsw = New-Object IO.FileSystemWatcher $folder, $filter -Property @{
IncludeSubdirectories = $false # <-- set this according to your requirements
NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite'
}