Skip to content

Instantly share code, notes, and snippets.

View dpaola2's full-sized avatar

Dave Paola dpaola2

View GitHub Profile
require "./spec/spec_helper"
describe User do
describe "#generate_api_key!" do
fixtures :users
<table class="table table-striped">
<thead>
<th width="80px;">Action</th>
<th>Task Details</th>
<th>Due</th>
<th>Status</th>
rake task:
passages.each do |passage|
words = deduplicate(passage)
words.each do |word|
Redis.set(word, retrieve_definition(word))
end
end
@dpaola2
dpaola2 / passages_spec.rb
Created June 14, 2012 19:54 — forked from unobliged/phs
passages helper spec
require 'spec_helper'
describe PassagesHelper do
describe "#unique_words" do
let(:passage) { FactoryGirl.create(:passage) }
passage.title.should eq("testFG")
end
end
@dpaola2
dpaola2 / operationengine.py
Created July 16, 2012 23:34 — forked from inportb/operationengine.py
operational composition and transformation in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## Copyright (C) 2011 by Jiang Yio <http://inportb.com/>
## The latest code is available at <https://gist.github.com/962122>
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
FactoryGirl.define do
# Default enrollment has mentor
factory :enrollment do
course_start_date { 1.week.ago.beginning_of_week }
birth_date { 1.week.ago.beginning_of_week - 2.days }
--- ERROR REPORT TEMPLATE -------------------------------------------------------
- What did you do?
I ran the command `/Users/dpaola2/.rvm/gems/jruby-9.0.0.0@global/bin/bundle install`
- What did you expect to happen?
I expected Bundler to...
- What happened instead?
@dpaola2
dpaola2 / query.sql
Last active December 14, 2016 23:16
WITH checkpoint_completion_counts AS (
SELECT
COUNT(checkpoint_completions.id) AS checkpoint_completions_count,
checkpoints.ref AS checkpoint_ref,
users.slug
FROM checkpoint_completions
INNER JOIN checkpoints ON checkpoint_completions.checkpoint_ref = checkpoints.ref
INNER JOIN users ON users.id = checkpoint_completions.user_id
GROUP BY 2,3
)
@dpaola2
dpaola2 / request_response.cxml
Created April 18, 2018 22:09
Request and Response from Staples cXML
REQUEST:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">
<cXML xml:lang='en-us' version='1.2.008' payloadID='1524089251.1.2179199@eden.io' timestamp='2018-04-18T15:07:31-07:00'>
<Header>
<From>
<Credential domain='NetworkId'>
<Identity>
edentechnologies-t
@dpaola2
dpaola2 / punchoutsetuprequest.cxml
Created April 18, 2018 22:20
punchoutsetuprequest.cxml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">
<cXML xml:lang='en-us' version='1.2.008' payloadID='1524089416.1.1993155@eden.io' timestamp='2018-04-18T15:10:16-07:00'>
<Header>
<From>
<Credential domain='NetworkId'>
<Identity>
edentech-t
</Identity>
</Credential>