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]; | |
} | |
} |
'use strict'; | |
import request from 'superagent'; | |
import Promise from 'bluebird'; | |
//set base headers here | |
const BASE_HEADERS = {}; | |
// set base url here | |
const BASE_URL = ''; |
#!/bin/bash | |
DESC="Selenium Grid Server" | |
RUN_AS="selenium" | |
JAVA_BIN="/usr/bin/java" | |
SELENIUM_DIR="/opt/selenium" | |
PID_FILE="$SELENIUM_DIR/selenium-grid.pid" | |
JAR_FILE="$SELENIUM_DIR/selenium-server.jar" | |
LOG_DIR="/var/log/selenium" |