Skip to content

Instantly share code, notes, and snippets.

@exprodrigues
exprodrigues / mongoose-transform.js
Last active Jun 6, 2021
Mongoose transform toObject()
View mongoose-transform.js
const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
const schema = new mongoose.Schema({
_id: String,
name: String,
email: String,
old: Number
});
View php-tail-log.php
<?php
if (isset($_GET['seek'])) {
$seek = $_GET['seek'];
$lines = [];
$handle = fopen('error_log', 'rb');
if ($seek > 0) {
fseek($handle, $seek);
}