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 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':
- 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
defmodule CartTest do
use ExUnit.Case
test "starts with empty count" do
assert Cart.count_items([]) == 0
View admin.js
addOrganization: function(orgName,orgAddress,orgSecAddress,orgPOCemail){
var loggedInUser = Meteor.user()
if (loggedInUser || Roles.userIsInRole(loggedInUser,['Admin'])){
View clientAdmin.js
if (Meteor.isClient){
console.log("subscribing to orgs")
'submit #newOrg':function(event){
orgName =
orgAddress =
orgSecAddress =
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) {
// ...
eval_date = moment(scores.point_date, "MM DD YYYY")
end_of_week = moment().isoWeekday(6)