Skip to content

Instantly share code, notes, and snippets.

View glassresistor's full-sized avatar

Mikela glassresistor

View GitHub Profile
┌───=[ mike :: unassigned -( 0 )-[ ~ ]
└──(date
Tue Feb 4 21:23:03 PST 2014
┌───=[ mike :: unassigned -( 0 )-[ ~ ]
└──(date
Tue Feb 4 21:27:43 PST 2014
┌───=[ mike :: unassigned -( 0 )-[ ~ ]
└──(date
var _ = require('lodash');
var tv4 = require('tv4');
var stringSchema = {
'type': 'string'
} ;
var componentSchema = {
'title': 'base component schema',
'type': 'object',
'required': ['metadata', 'slug', 'content_type', 'schema_name'],
'properties': {
var _ = require('lodash');
var tv4 = require('tv4');
var stringSchema = {
'type': 'string'
} ;
var componentSchema = {
'title': 'base component schema',
'type': 'object',
'required': ['metadata', 'slug', 'content_type', 'schema_name'],
'properties': {
var _ = require('lodash');
var b = {
'a': {'a': 1},
'b': {'b': 1}
};
var a = _.defaults({'a': { 'a': 2}}, b);
a.a.a = 10;
a.b.b = 10;
console.log(b);
var pergatory = function(success, error) {
if (error == undefined) {
return null;
} else {
return error({
'code': 1,
'message': 'bad'
});
}
};
@glassresistor
glassresistor / drupal-export.sql
Last active August 29, 2015 13:57
Building an article !?!?!?!
select * from content_type_article as article
left join node ON article.nid = node.nid and article.nid = node.nid
left join content_field_dek as dek ON node.nid = dek.nid and node.vid = dek.vid
left join content_field_article_text as body ON node.nid = body.nid and node.vid = body.vid
left join content_field_alternate_dek as alt_dek ON node.nid = alt_dek.nid and node.vid = alt_dek.vid
left join content_field_alternate_title as alt_title ON node.nid = alt_title.nid and node.vid = alt_title.vid
left join content_field_social_dek as social_dek ON node.nid = social_dek.nid and node.vid = social_dek.vid
var stringSchema = function() {
return _.clone({ 'some': 'associative array'})
}
var express = require('express');
var app = express();
var fs = require('fs');
var respond = function (req, res) {
res.status(200).sendfile(__dirname + 'build/index.html');
}
app.use('/css', express.static(__dirname + 'build/css/'));
app.use('/js', express.static(__dirname + 'build/js/'));
In [8]: dir(app.module)
Out[8]:
['__builtins__',
'__cached__',
'__doc__',
'__file__',
'__initializing__',
'__loader__',
'__name__',
'__package__',
Internal Server Error: /mirrors/schemas
Traceback (most recent call last):
File "/home/mojo/code/mirrors_server/ENV/src/django/django/core/handlers/base.py", line 113, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/mojo/code/mirrors/mirrors/views.py", line 92, in component_schemas
schemas[key] = schema()
TypeError: 'str' object is not callable