-
Define your models with a transport (this is just sugar for can-connect)
import { Model, transport } from 'ylem-model'; const Person = Model({ id: { type: 'number', identity: true }, name: { type: 'string' }, email: { type: 'string' }, age: { type: 'number' },
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(\s{2})(module|test) | |
$1QUnit.$2 | |
([\d]+), function \((?:assert)?\) \{([\s]+) | |
function (assert) {$2assert.expect($1);$2 | |
([\"]), function \((?:assert)?\) \{ | |
", function (assert) { | |
(\s)(equal|notEqual|ok|notOk|propEqual|notPropEqual|deepEqual|notDeepEqual|strictEqual|notStrictEqual| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Only showing relevant changes | |
// The folllowing changes must be made in all of your models | |
var Author = sequelize.define('Authors', { | |
... | |
}, { | |
classMethods: { | |
// Create a static 'associate' method - will be called later | |
associate: function (models) { | |
Author.hasMany(models.Books, { as: 'books' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.click-collect .form-control.input-lg, | |
.click-collect .input-group-lg > .form-control, | |
.click-collect .address-form .input-group-lg > .address-first-name, | |
.address-form .click-collect .input-group-lg > .address-first-name, | |
.click-collect .address-form .input-group-lg > .address-last-name, | |
.address-form .click-collect .input-group-lg > .address-last-name, | |
.click-collect .address-form .input-group-lg > .address-one, | |
.address-form .click-collect .input-group-lg > .address-one, | |
.click-collect .address-form .input-group-lg > .address-two, | |
.address-form .click-collect .input-group-lg > .address-two, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* This file is useful for x-www-form-urlencoded requests where all data is a string. | |
* If the request uses application/json, this middleware is not needed. | |
* This loops over all of the data and converts strings to their primitive form, | |
* basically normalizing numbers, booleans, and null/undefined/'' values. | |
* This could potentially have side effects, though none were encountered after | |
* months of using this middleware on a busy project. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import DefineMap from 'can-define/map/map'; | |
import ObservationRecorder from 'can-observation-recorder'; | |
import Component from 'react-view-model/component'; | |
class Parent extends Component { | |
static ViewModel = DefineMap.extend({}); | |
render() { | |
console.log('Parent render'); | |
return <Child time={new Date()} />; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wkx = require('wkx') | |
var pg = require('pg') | |
var pgUtil = require('pg/lib/utils') | |
const geoParser = { | |
init(knex){ | |
// 1. Convert postgis data coming out of the db into geoJSON | |
// Every postgres installation will have different oids for postgis geo types. | |
knex | |
.raw('SELECT oid, typname AS name FROM pg_type WHERE typname IN (\'geography\', \'geometry\');') |
I hereby claim:
- I am DesignByOnyx on github.
- I am ryanwheale (https://keybase.io/ryanwheale) on keybase.
- I have a public key whose fingerprint is 0DAA EB7B A5F5 F7AB 35F4 7593 818E 802D A122 192F
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Sequelize = require('sequelize'); | |
const sequelize = new Sequelize('postgres://db_user:db_pass@localhost:5432/findandcount-test', { | |
dialect: 'postgres' | |
}); | |
const Property = sequelize.define('properties', { | |
name: { | |
type: Sequelize.STRING, | |
allowNull: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Minified: | |
javascript: !function(e){for(var t,n=/(.*)(#\/[^'"<]+)(['"<]?.*)/,a=location.href.split("/").slice(0,-1).join("/"),l=e.evaluate("//td[contains(., '$ref')]/span/text()",e,null,4,null),o=[];t=l.iterateNext();)n.test(t.textContent)&&o.push(t);o.forEach(({parentNode:e,textContent:t})=>{let l=t.replace(n,"$2").split("/").pop();e.innerHTML=e.innerHTML.replace(n,`$1<a href="${a+"/"+l+".yaml"}">$2</a>$3`)})}(document); | |
*/ | |
// tslint:disable | |
(function(doc) { | |
var regRef = /(.*)(#\/[^'"<]+)(['"<]?.*)/; | |
var basePath = location.href.split("/").slice(0, -1).join("/"); | |
var matches = doc.evaluate("//td[contains(., '$ref')]/span/text()", doc, null, 4, null); | |
var nodes = []; | |
var node; |
OlderNewer