Instantly share code, notes, and snippets.

View watchcopy.ps1
#
# 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'
}
View MainPage.Xaml.CS
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;
View heroku terminal
~ $ 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
View cart.exs
# 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
View admin.js
Meteor.methods({
addOrganization: function(orgName,orgAddress,orgSecAddress,orgPOCemail){
var loggedInUser = Meteor.user()
if (loggedInUser || Roles.userIsInRole(loggedInUser,['Admin'])){
Orgs.insert({
orgName:orgName,
View clientAdmin.js
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
View gist:f34bd884767cb3fb6d5d
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)