Skip to content

Instantly share code, notes, and snippets.

View papajuans's full-sized avatar
🙃

Ryan J papajuans

🙃
  • NY
View GitHub Profile
// MongoDB collection
// articles
{ id: '123', revision: 1, hed: 'My Title', body: 'foo bar bat baz' }
{ id: '123', revision: 2, hed: 'My Title Updated', body: 'foo bar bat baz' }
// galleries
{ id: '444', revision: 1, hed: 'My Gallery', body: 'foo bar bat baz' }
{ id: '444', revision: 2, hed: 'My Gallery Updated', body: 'foo bar bat baz' }

Keybase proof

I hereby claim:

  • I am papajuans on github.
  • I am papajuans (https://keybase.io/papajuans) on keybase.
  • I have a public key whose fingerprint is 94E6 153D 91F2 2570 2A0C 7F9D B2C4 7D84 14D0 89D4

To claim this, I am signing this object:

'use strict';
var levelup = require('levelup')
var fs = require('fs');
var db = levelup('./ldb');
var bytes = fs.readFileSync('./image.jpeg', 'binary');
var c = 0;
@papajuans
papajuans / makehub
Created November 5, 2015 23:04
Hello World
# Title
Hello World
# Picture
media: undefined
# Objective
undefined
# Duration
undefined
# Age Group
undefined
@papajuans
papajuans / bulk.js
Created June 3, 2013 20:37
Bulk get
// Expecting something like /photos/bulk?ids=123,456
app.get('/photos/bulk', function(req, res, next) {
var ids = req.query.ids.split(',');
Photo.find({_id : {$in: ids}}, function(err, photos) {
if(err) {
next(err)
} else if (photos) {
var wrapped = {};
for(var i = 0; i < photos.length; i++) {
var p = photos[i];
@papajuans
papajuans / gist:5545160
Created May 9, 2013 02:27
req-perf-rewrite slideshow
vagrant@precise64:~$ ab -k -c 5 -n 100 http://10.201.240.68:3002/slideshows
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 10.201.240.68 (be patient).....done
Server Software:
Server Hostname: 10.201.240.68
@papajuans
papajuans / gist:5545154
Created May 9, 2013 02:25
promise slideshow-service
vagrant@precise64:~$ ab -k -c 5 -n 100 http://10.201.240.68:3002/slideshows
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 10.201.240.68 (be patient).....done
Server Software:
Server Hostname: 10.201.240.68
@papajuans
papajuans / vimrc
Created June 12, 2011 19:15
my vimrc
" Cobbled together from the internet (mostly from
" rtomayko's dotfiles on github:
" http://github.com/rtomayko/dotfiles/blob/rtomayko/.vimrc)
" ----------------------------------------------------------
" GENERAL
" ----------------------------------------------------------
set nocompatible " No vi compatibility
set history=1000 " lots of history
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 8, in <module>
load_entry_point('virtualenv==1.4.3', 'console_scripts', 'virtualenv')()
File "/Library/Python/2.6/site-packages/virtualenv-1.4.3-py2.6.egg/virtualenv.py", line 528, in main
use_distribute=options.use_distribute)
File "/Library/Python/2.6/site-packages/virtualenv-1.4.3-py2.6.egg/virtualenv.py", line 611, in create_environment
site_packages=site_packages, clear=clear))
File "/Library/Python/2.6/site-packages/virtualenv-1.4.3-py2.6.egg/virtualenv.py", line 689, in install_python
for fn in os.listdir(stdlib_dir):
OSError: [Errno 13] Permission denied: '/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages'
#!/bin/bash
LOCAL_BASHRC_VER="1.7.3"
#
# !!! DO NOT FORGET TO UPDATE LOCAL_BASHRC_VER WHEN COMMITTING CHANGES !!!
#
# $Id: .bashrc 432 2006-09-12 19:15:05Z bklang $
# v1.7.3 Add missing 1.7.3 version tag and alkaloiddev network
# Rev 420: This one goes out to Bryan
# Mute perl warnings (deja-vu?)
# Reset term color after printing PATH warning