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
// ==UserScript== | |
// @name netflix | |
// @namespace http://tampermonkey.net/ | |
// @version 0.3 | |
// @description try to take over the world! | |
// @author You | |
// @match *://www.netflix.com/* | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== |
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
#!/bin/sh | |
SOURCE_PATH="/tmp/run/mountd/sda1" | |
exec >> $SOURCE_PATH/update-log.txt 2>&1 | |
echo creating dmesg file | |
dmesg > $SOURCE_PATH/dmesg.txt |
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
let isPrimitive = function(value) { | |
let primitiveTypes = [ | |
'number', | |
'boolean', | |
'string' | |
]; | |
return (primitiveTypes.indexOf(typeof value) !== -1) || util.isDate(value) || (value === null) || (value.constructor && (value.constructor.name === 'ObjectID')); | |
}; |
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
let primitiveTypes = [ | |
'number', | |
'boolean', | |
'string' | |
]; | |
var flatten = function(parent, prefix, child) { | |
if (isPrimitive(child)) { | |
if (!parent) { | |
parent = {}; |
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'; | |
var loggly = require('node-loggly-bulk'); | |
module.exports = function(Model, methods) { | |
var buildEvent = function(ctx) { | |
var req = ctx.req; | |
var method = ctx.method; | |
var error = ctx.error; |
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
diff --git a/lib/include.js b/lib/include.js | |
index d36d497..052da5f 100644 | |
--- a/lib/include.js | |
+++ b/lib/include.js | |
@@ -334,12 +334,13 @@ Inclusion.include = function(objects, include, options, cb) { | |
} | |
//Let's add a placeholder where query | |
filter.where = filter.where || {}; | |
+ var filterKey = (relation.type === 'hasOne') ? relation.keyFrom : relation.keyTo; | |
//if fields are specified, make sure target foreign key is present |
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
registry.modelBuilder.mixins.define 'MyMixin', require './mixins/my-mixin' | |
Model.mixin 'MyMixin' | |
Model.defineProperty 'email', { type: String, required: true } | |
registry.configureModel Model, | |
acls: [ | |
{ | |
principalType: 'Role' | |
principalId: '$everyone' |
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
export default function(app, options = {}) { | |
app.connector('live', require('./connector/live')); | |
app.dataSource('live', | |
{connector: 'live'}); | |
let { registry } = app; | |
let createModel = function(model) { |
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
function includeOneToOne(callback) { | |
var targetIds = []; | |
var objTargetIdMap = {}; | |
var lookupKey = (relation.type === 'belongsTo') ? relation.keyFrom : relation.keyTo; | |
for (var i = 0; i < objs.length; i++) { | |
var obj = objs[i]; | |
if (relation.type === 'belongsTo') { | |
if (obj[lookupKey] === null || |
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
let debug = require('debug')('loopback:hooks:wrap'); | |
import async from 'async'; | |
import { createPromiseCallback } from 'loopback-datasource-juggler/lib/utils'; | |
import { inspect } from 'util'; | |
export default function(server) { | |
let callback = function(args) { |
NewerOlder