Some exercises from the Falsy Values workshops.
The good parts:
- HTTP server and client in same script
- Express cookies example
- Express routing example
- Express error handling
- Express middlewares example
- Simple HTTP proxy
| const http2 = require('http2'); | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const zlib = require('zlib'); | |
| const brotli = require('brotli'); // npm package | |
| const PORT = 3032; | |
| const BROTLI_QUALITY = 11; // slow, but we're caching so who cares | |
| const STATIC_DIRECTORY = path.resolve(__dirname, '../dist/'); | |
| const cache = {}; |
Some exercises from the Falsy Values workshops.
The good parts:
| #!/usr/sbin/dtrace -s | |
| /* | |
| * mysqld_pid_fslatency_slowlog0.d Print slow filesystem I/O events. | |
| * | |
| * USAGE: ./mysql_pid_fslatency_slowlog0.d mysqld_PID | |
| * | |
| * This traces all mysqld filesystem I/O (including some that may be | |
| * asynchronous to queries and not causing query latency), and prints | |
| * those individual I/O taking longer than the MIN_FS_LATENCY_MS tunable. | |
| * |
| /* CSS */ | |
| $height: 85px; | |
| $width: 700px; | |
| .container { position: relative } | |
| .card { | |
| height: $height; | |
| width: $width; | |
| z-index: 1; |
| require 'dalton/strategies/skroutz' | |
| require 'dalton/strategies/facebook' | |
| require 'dalton/strategies/openid' # yahoo, #google | |
| require 'dalton/strategies/twitter' | |
| # Setup OpenId file storage, don't change the storage engine! | |
| require 'openid/store/filesystem' | |
| Rails.configuration.middleware.use(Rack::OpenID, | |
| OpenID::Store::Filesystem.new(Rails.root + 'tmp/openid')) |