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
# /node_modules/feathers-mongodb/lib/index.js | |
# Patched version of _get() | |
_get (id, params = {}) { | |
const { query } = this.filterQuery(params); | |
query.$and = (query.$and || []).concat({ [this.id]: this._objectifyId(id) }); | |
let result = null; | |
if (params.inTransaction) | |
result = this.Model.findOneAndUpdate(query, {$set: { myLock: 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
time 1.6452050209 --- d4 = d1.copy(); d4.update(d2), d4.update(d3) | |
time 1.69228887558 --- d4 = dict(d1, **d2); d4.update(d3) | |
time 1.78650903702 --- d4 = {}; d4.update(d1); d4.update(d2), d4.update(d3) | |
time 1.92449307442 --- d4 = {} for d in (d1, d2, d3): d4.update(d) | |
time 2.00036215782 --- d4 = dict(d1, **d2); d5=dict(d4, **d3) | |
time 2.04427695274 --- d4 = dict(d1) for d in (d2, d3): d4.update(d) | |
time 2.68033099174 --- d4 = reduce(lambda x,y: dict(x, **y), (d1, d2, d3)) | |
time 3.72226691246 --- d4 = dict(chain(*[d.iteritems() for d in (d1, d2, d3)])) | |
time 4.01872420311 --- d4 = dict(d1.items() + d2.items() + d3.items()) | |
time 4.07779598236 --- d4 = dict(chain.from_iterable(d.iteritems() for d in (d1, d2, d3))) |
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/bash | |
# | |
# Configure postfix to relay all emails through gmail. | |
# | |
# Also install mailx to send testmails. | |
# | |
# Based on | |
# http://mhawthorne.net/posts/postfix-configuring-gmail-as-relay.html | |
# http://carlton.oriley.net/blog/?p=31 | |
# http://opentodo.net/2013/03/postfix-smtp-relay-to-smtp-gmail-com/ |
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/env python | |
# | |
# glassfish Startup script for the Glassfish java application server. | |
# | |
# chkconfig: 2345 85 15 | |
# description: GlassFish is an open source application server project started \ | |
# by Sun Microsystems for the Java EE platform and now sponsored \ | |
# by Oracle Corporation. The supported version is called Oracle \ | |
# GlassFish Server. GlassFish is free software, dual-licensed \ | |
# under two free software licences: the Common Development and \ |
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/bash | |
# Startup script for Glassfish. | |
# | |
# chkconfig: 2345 95 05 | |
# description: Start the java application server, glassfish. | |
# pidfile: /var/run/glassfish.pid | |
# | |
# Used and tested on centos 6 | |
# | |
# Author: [email protected] |