Skip to content

Instantly share code, notes, and snippets.

schema: {
pmcid: Joi.number().required(),
siteid: Joi.number().required(),
prospects: Joi.array().min(1).required().includes(Joi.object().keys({
Prospect: Joi.object().required().keys({
email: Joi.string().required(),
firstname: Joi.string().required(),
lastname: Joi.string().required(),
numbers: Joi.object().optional().keys({
phonenumbers: Joi.array().required().includes(Joi.object().keys({
/* jshint node: true */
module.exports = function (environment) {
var ENV = {
modulePrefix: 'nitrous',
environment: environment,
baseURL: '/',
locationType: 'hash',
EmberENV: {
FEATURES: {
@jakecraige
jakecraige / async-test.cljs
Created October 21, 2014 01:57
core-async, it's just like ES6 Generators!
(def db (pouch/create-db "todos"))
(go
(<! (pouch/put-doc db {:_id (now) :text "Todo 1"}))
(<! (pouch/put-doc db {:_id (now) :text "Todo 2"}))
(let [res (<! (pouch/all-docs db))]
(println res)))
@jakecraige
jakecraige / om.cljs
Created October 18, 2014 23:11
Todos Example - Om + Om-Tools vs. Reagent
(ns todos-example.core
(:require [om.core :as om :include-macros true]
[om-tools.dom :as dom :include-macros true]
[om-tools.core :refer-macros [defcomponent]]))
(def app-state (atom {}))
(def firebase-root "https://cljs-todos.firebaseio.com/todos")
(def r (js/Firebase. firebase-root))
'use strict';
var path = require('path');
var commands = require('./lib/commands');
var postBuild = require('./lib/tasks/post-build');
module.exports = {
name: 'ember-cli-cordova',
blueprintsPath: function() {
@jakecraige
jakecraige / get-request.sh
Last active August 29, 2015 14:05
Failed get request to SOAP service. Works in all other avenues I've tried but node will not respond.
# Returns as you'd expect
echo "require('https').get('https://github.com/jakecraige.json', function(res) { console.log(res); });" | node
# Won't return, eventually throws ECONNRESET
echo "require('https').get('https://gateway.rpx.realpage.com/rpxgateway/PricingAndAvailability.svc', function(res) { console.log(res); });" | node
import Ember from 'ember';
export default Ember.Route.extend({
afterModel: function() {
this._super.apply(this, arguments);
var pushChannelName = this.pushChannelName || this.routeName;
var pushChannel = this.pushChannelFor(pushChannelName);
this.setupPushChannel(pushChannel, model);
},
additionalInformations: hasMany('additional-information',{ async: true }),
promos: Ember.computed.filterBy('additionalInformations', 'type', 'Promo'),
sortedContent: function() {
var content = this.get('content');
if (this.get('softDelete')) {
content = content.filterBy('softDeleted', false)
if (this.get('vendorSelected')) {
content = content.filterBy('vendor', this.get('vendorSelected'));
}
}
{{input type="checkbox" checked=value name="onoffswitch" class="onoffswitch-checkbox"}}
<label class="onoffswitch-label" for="myonoffswitch">
<div class="onoffswitch-inner"></div>
<div class="onoffswitch-switch"></div>
</label>