Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am henryoswald on github.
  • I am henryoswald (https://keybase.io/henryoswald) on keybase.
  • I have a public key ASArUOniElnAauGcWjsBDBoe1YxQERXBA87JS7EjElW6kgo

To claim this, I am signing this object:

@henryoswald
henryoswald / profile.sh
Created June 6, 2017 16:03
profile redis data with rdb tools
#!/bin/bash
rdb -c memory $1 > memory.csv
sort -t"," -n -k4 memory.csv > sorted.csv
grep -a "sess" sorted.csv> sess.csv
grep -a "DocsWithHistoryOps" sorted.csv > DocsWithHistoryOps.csv
grep -a "DocOps" sorted.csv > DocOps.csv
grep -a "doclines" sorted.csv > doclines.csv
async = require("async")
Project = require('./app/js/models/Project').Project
_ = require("lodash")
warmup = "55928319efc30e705817817e"
smallproject = "561e86173cfc7400525834a6"
twokproject = "5637a97beafc8c7b5bfc487a"
fourkproject = "55ef4b39f5e895afbaf2085d"
realmassive = "57b1ea8674e706f567b5afe9"
twokimageproject = "55ef4b39f5e895afbaf2085f"
Only in web-api-sharelatex-blue/current/app/coffee/Features/Analytics: AnalyticsController.coffee
Only in web-api-sharelatex-blue/current/app/coffee/Features/Analytics: AnalyticsManager.coffee
diff -r web-api-sharelatex-blue/current/app/coffee/Features/Authentication/AuthenticationController.coffee web-api-sharelatex-green/current/app/coffee/Features/Authentication/AuthenticationController.coffee
12,13d11
< UserSessionsManager = require("../User/UserSessionsManager")
< Analytics = require "../Analytics/AnalyticsManager"
18c16
<
---
>
@henryoswald
henryoswald / app.js
Last active August 16, 2016 15:19
passport.js example
var express = require('express');
var app = express();
var cookieParser = require("cookie-parser")
var bodyParser = require("body-parser")
var passport = require('passport');
var session = require('express-session');
var LocalStrategy = require('passport-local').Strategy;
app.use(cookieParser())
{
"_id" : ObjectId("56e6c9ddd6582f0f52a90684"),
"folders" : [
{
"_id" : ObjectId("56e81bc232d4148654cef0fe"),
"folders" : [ ],
"fileRefs" : [ ],
"docs" : [
{
"_id" : ObjectId("56e81bc232d4148654cef0ff"),
fs = require("fs")
bib2json = require("./bib2json.js")
f = fs.readFileSync("../listb.bib", "utf-8")
_ = require("lodash")
json = bib2json(f)
j = _.map json.entries, (ent)->
return {key:ent.EntryKey, author:ent.Fields.author, journal: ent.Fields.journal, title:ent.Fields.title, year: ent.Fields.year}
@henryoswald
henryoswald / gist:8ff9cf917e63c2e983dd
Created July 19, 2015 15:57
db.serverStatus() on primary server
{
"host" : "primary-mongodb",
"version" : "3.0.3",
"process" : "mongod",
"pid" : NumberLong(24890),
"uptime" : 1671011,
"uptimeMillis" : NumberLong(1671011524),
"uptimeEstimate" : 1655592,
"localTime" : ISODate("2015-07-19T15:55:42.960Z"),
"asserts" : {
@henryoswald
henryoswald / gist:0ca8d12b594be9d1b745
Created May 26, 2015 12:54
create random users with projects and linking
UserCreator = require("./app/js/Features/User/UserCreator")
ProjectCreationHandler = require("./app/js/Features/Project/ProjectCreationHandler")
CollaboratorsHandler = require("./app/js/Features/Collaborators/CollaboratorsHandler")
uuid = require('node-uuid')
async = require("async")
_ = require("underscore")
require("./app/js/Features/Email/EmailSender").sendEmail= (opts, cb)->
cb()
@henryoswald
henryoswald / gist:552d1a2a747f01537577
Created November 17, 2014 13:19
process redis db
sort -t"," -n -k4 memory.csv > sorted.csv
grep "DocOps" sorted.csv> docops.csv
grep "sess" sorted.csv> sess.csv
grep "doclines" sorted.csv> doclines.csv
grep "tpds" sorted.csv> tpds.csv
grep UncompressedHistoryOps sorted.csv> historyops.csv
grep "project_last_updated" sorted.csv> lastupdated.csv