I hereby claim:
- I am evancauwenberg on github.
- I am evancauwenberg (https://keybase.io/evancauwenberg) on keybase.
- I have a public key ASCzpv8YmWy5nujDdH0kvpgB5aI7l6NG7nKzK_5prPrjEAo
To claim this, I am signing this object:
const path = require('path'); | |
const fs = require('fs'); | |
const { Transform } = require('stream'); | |
const csv = require('fast-csv'); | |
class PersistStream extends Transform { | |
constructor(args) { | |
super({ objectMode: true, ...(args || {}) }); | |
this.batchSize = 100; | |
this.batch = []; |
I hereby claim:
To claim this, I am signing this object:
var date = new Date(); | |
var daysToDeletion = 120; | |
var deletionDate = new Date(date.setDate(date.getDate() - daysToDeletion)); | |
printjson(deletionDate); | |
var db = db.getSiblingDB('db') | |
db.getMongo().setSlaveOk(); | |
printjson(db.messages.find({insertDate : {$lt : deletionDate}}).count()); |
_read() { | |
// // List all xml tags that have more than one child. | |
this.xmlStream.collect('title'); | |
// // catch error | |
// this.xmlStream.on('error', console.log); | |
this.xmlStream.on(`updateElement: ${this.elementToExtract}`, (updateElement) => { | |
this.push(updateElement); | |
}); |
<?php | |
use Symfony\Component\HttpFoundation\File\File; | |
use Symfony\Component\HttpFoundation\File\UploadedFile; | |
/** | |
* @Entity | |
*/ | |
class Document | |
{ |
# Create your superuser | |
$ mongo | |
> use admin | |
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]}) | |
> exit | |
# Alias for convenience (optional and at your own risk) | |
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile | |
$ source ~/.bash_profile |
<?php | |
class IteratorsPriorityQueue extends SplPriorityQueue {} | |
function getNthIterator($n, $s, $nthA, $bList) { | |
for ($i=0; $i < $s; $i++) { | |
yield $nthA * $bList[$i]; | |
} | |
} |
{ | |
"name": "jaytaph/security-example", | |
"require": { | |
"symfony/security-core": "~2.8" | |
}, | |
"authors": [ | |
{ | |
"name": "Joshua Thijssen", | |
"email": "jthijssen@noxlogic.nl" | |
} |
<?php | |
// app/AppKernel.php | |
use Symfony\Component\Config\Loader\LoaderInterface; | |
use Symfony\Component\HttpKernel\Kernel; | |
class AppKernel extends Kernel | |
{ | |
public function registerBundles() | |
{ |