(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| from jinja2.environment import create_cache | |
| # blah blah blah | |
| app.jinja_env.cache = create_cache(1000) | |
| # blah blah blah | |
| app.run() |
| from flask import Flask as DefaultFlask | |
| class Flask(DefaultFlask): | |
| def create_jinja_environment(self): | |
| self.jinja_options = dict(self.jinja_options) | |
| if 'JINJA_CACHE_SIZE' in self.config: | |
| self.jinja_options['cache_size'] = self.config['JINJA_CACHE_SIZE'] | |
| return super(Flask, self).create_jinja_environment() |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/usr/bin/env perl | |
| # | |
| # htpasswd.pl | |
| # | |
| # Copyright (c) 2013, Gelu Lupas <[email protected]> | |
| # | |
| # Permission to use, copy, modify, and/or distribute this software for any | |
| # purpose with or without fee is hereby granted, provided that the above | |
| # copyright notice and this permission notice appear in all copies. | |
| # |
| #!/usr/bin/env perl | |
| use Mojolicious::Lite; | |
| use Mojo::JSON 'j'; | |
| use Mojo::Asset::Memory; | |
| use File::Spec; | |
| helper send_ready_signal => sub { | |
| my $self = shift; | |
| my $payload = { ready => \1 }; |
| import java.util.*; | |
| import java.io.*; | |
| import java.security.*; | |
| public class ChangePassword | |
| { | |
| private final static JKS j = new JKS(); | |
| public static void main(String[] args) throws Exception | |
| { |
Here's a few things I tried to write output to a python subprocess pipe.
from subprocess import Popen, PIPE
p = Popen('less', stdin=PIPE)
for x in xrange(100):
p.communicate('Line number %d.\n' % x)