This gist is to help me find a way to determine the updated collection and the operation (document insertion, update or removal) from inside a Mongoose hook.
git clonethis gist- Run
npm install - Execute with
node app.js
| <?php | |
| // Ajoute le namespace CSS à chaque "début de mot" en gérant le | |
| // fait que les noms de classe peuvent contenir des "-". | |
| // Cela doit être géré de manière particulière car \w = [a-zA-Z0-9_] | |
| preg_replace( | |
| // Partie de RegEx | Correspond à... | |
| // -------------------- | ------------- | |
| //(?<!-) | Si ce qui suit n'est pas précédé d'un "-" |
| #!/bin/bash | |
| # Unexpand the "svn:id" SVN property ($Id$) | |
| # | |
| # Anywhere the expanded "$Id$" string (eg. "$Id: Foobar.php 42 1970-01-01 00:00:00Z jdoe$") | |
| # is found, it is replaced by "$Id". | |
| # Usefull to quickly compare code file-by-file | |
| DIR="$1" |
| # Path where to work | |
| IPXE_DIRPATH="/opt/ipxe" | |
| # Create some directories | |
| mkdir -p "${IPXE_DIRPATH}/"{ipxe_project,builder} | |
| # Fetch iPXE source files | |
| cd "${IPXE_DIRPATH}/ipxe_project" | |
| git clone https://github.com/ipxe/ipxe.git . |
| /** | |
| How to use: | |
| 1/ Use the following line as the "URL" of a bookmark in your web browser. | |
| 2/ Place the bookmark in the bookmark bar for easy access. | |
| 3/ When on a steampowered.com page, click on the bookmark and the corresponding steamdb.info page will open. | |
| */ | |
| javascript:(function(){if (window.location.hostname == 'store.steampowered.com') {var pathMatch = window.location.pathname.match(/^\/(?<appType>(app|bundle|sub))\/(?<appId>\d+)\//);pathMatch && window.open('https://steamdb.info/' + pathMatch.groups.appType + '/' + pathMatch.groups.appId + '/?source=bookmarklet','_blank');}})(); |
| const { MongoMemoryServer } = require('mongodb-memory-server'); | |
| const mongoose = require('mongoose'); | |
| const mongoServer = new MongoMemoryServer({ | |
| 'instance': { | |
| 'dbName': 'temp', | |
| 'port': 35555, | |
| } | |
| }); |
| const { MongoMemoryServer } = require('mongodb-memory-server'); | |
| const mongoose = require('mongoose'); | |
| const mongoServer = new MongoMemoryServer({ | |
| 'instance': { | |
| 'dbName': 'temp', | |
| 'port': 35555, | |
| } | |
| }); |
| -- | |
| -- LUA script for Domoticz that controls an MPD server (via `mpc` client) under | |
| -- the orders of a dummy Domoticz dimmer device. | |
| -- | |
| -- No configuration required on the device, the LUA script listen to order such | |
| -- as "Set Level: 42 %" and sends adequate `mpc volume` commands. | |
| -- | |
| commandArray = {} | |
| -- Name of the dummy Domoticz dimmer: |
This is an answer to https://twitter.com/developius/status/892470102632923136 about his SSL with Docker Swarm, Let's Encrypt and Nginx blog post and a way to not kill Nginx for certificate generation/renewal.
(from what I read in the blog post)
/etc/letsencrypt directory so that certificates are on the host and not on the container.| #!/usr/bin/perl | |
| # | |
| # Script to create an ICS version of the Blend Web Mix 2015 program (http://www.blendwebmix.com/programme.html) | |
| # | |
| # Parses the program web page, every conference web pages and creates an ICS | |
| # | |
| # @author DUVERGIER Claude (http://blog.claude.duvergier.fr) | |
| use 5.010; |