$ openssl genrsa -out private.key 4096openssl req -new -sha256 \This cheat sheet describes my usage/implementation of virtualenv with virtualenv wrapper and the bash foo that I added with the help of many blogs to make it all tick together in fun land.
Quick Reference
$ echo $WORKON_HOME
/Users/benjamin/.virtualenvs
$ echo $PROJECT_HOME
| var Promise = require("bluebird"); | |
| var Request = require("superagent").Request; | |
| /** | |
| * @namespace utils | |
| * @class Superagent | |
| */ | |
| /** |
A quick overview of the node.js streams interface with basic examples.
This is based on @brycebaril's presentation, Node.js Streams2 Demystified
Streams are a first-class construct in Node.js for handling data.
Think of them as as lazy evaluation applied to data.
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
| #!/bin/bash | |
| NAME="hello_app" # Name of the application | |
| DJANGODIR=/webapps/hello_django/hello # Django project directory | |
| SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket | |
| USER=hello # the user to run as | |
| GROUP=webapps # the group to run as | |
| NUM_WORKERS=3 # how many worker processes should Gunicorn spawn | |
| DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use | |
| DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name |
Note: Some of these keymapping are specific to IdeaVim plugin. If you don't use IdeaVim (what' wrong with you :)), I've tried to point out where they differ, but I could have missed a few
Ctrl-P - Popup parameter documentation for method calls| source :rubygems | |
| gem 'shotgun', :group=>:development | |
| gem 'rack-cache' | |
| gem 'sinatra', :require => 'sinatra/base' | |
| gem 'sinatra-support' | |
| gem 'haml' |
| module A | |
| def self.included(target) | |
| v = target.instance_methods.include?(:method_name) | |
| puts "in included: #{v}" | |
| end | |
| def self.append_features(target) | |
| v = target.instance_methods.include?(:method_name) | |
| puts "in append features before: #{v}" | |
| super |