This is a rough proof of concept.
There will be broken things.
Comments are welcome.
Installation
| http { | |
| log_format bodylog '$remote_addr - $remote_user [$time_local] ' | |
| '"$request" $status $body_bytes_sent ' | |
| '"$http_referer" "$http_user_agent" $request_time ' | |
| '<"$request_body" >"$resp_body"'; | |
| lua_need_request_body on; | |
| set $resp_body ""; | |
| body_filter_by_lua ' |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| # A VirtualBox bug forces vagrant to serve | |
| # corrupt files via Apache or nginx | |
| # The solution to that would be to turn off | |
| # the SendFile option in apache or nginx | |
| # | |
| # If you use apache as your main web server | |
| # add this directive in your httpd.conf (or apache.conf) | |
| # configuration file name may vary in various systems | |
| # | |
| EnableSendfile off |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
| /* Solarized Dark | |
| For use with Jekyll and Pygments | |
| http://ethanschoonover.com/solarized | |
| SOLARIZED HEX ROLE | |
| --------- -------- ------------------------------------------ | |
| base03 #002b36 background | |
| base01 #586e75 comments / secondary content |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>HTML5 Starter Template</title> | |
| <meta name="description" content="Starter Template"> | |
| <meta name="author" content="Gregry Pike"> | |
| <link rel="stylesheet" href="css/styles.css?v=1.0"> | |
| <!--[if lt IE 9]> | |
| <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> |
| { | |
| "USD": { | |
| "symbol": "$", | |
| "name": "US Dollar", | |
| "symbol_native": "$", | |
| "decimal_digits": 2, | |
| "rounding": 0, | |
| "code": "USD", | |
| "name_plural": "US dollars" | |
| }, |
Many programming languages, including Ruby, have native boolean (true and false) data types. In Ruby they're called true and false. In Python, for example, they're written as True and False. But oftentimes we want to use a non-boolean value (integers, strings, arrays, etc.) in a boolean context (if statement, &&, ||, etc.).
This outlines how this works in Ruby, with some basic examples from Python and JavaScript, too. The idea is much more general than any of these specific languages, though. It's really a question of how the people designing a programming language wants booleans and conditionals to work.
If you want to use or share this material, please see the license file, below.
| from django.contrib import admin | |
| class ReadOnlyModelAdmin(admin.ModelAdmin): | |
| """ | |
| ModelAdmin class that prevents modifications through the admin. | |
| The changelist and the detail view work, but a 403 is returned | |
| if one actually tries to edit an object. |