Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| // XPath CheatSheet | |
| // To test XPath in your Chrome Debugger: $x('/html/body') | |
| // http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
| // 0. XPath Examples. | |
| // More: http://xpath.alephzarro.com/content/cheatsheet.html | |
| '//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |
| In a code cell at the beginning of your notebook, enter: | |
| %%html | |
| <style type="text/css"> | |
| span.ecb { background: yellow; } | |
| </style> | |
| Then in any other markdown cell you can put: |
| # IPython magic to check for PEP8 compliance. | |
| # Author: Juan Luis Cano <juanlu001@gmail.com> | |
| """IPython magic to check for PEP8 compliance. | |
| To use it, type | |
| ```%load_ext pep8magic``` | |
| and then |
Generally useful links:
| " copy all this into a vim buffer, save it, then... | |
| " source the file by typing :so % | |
| " Now the vim buffer acts like a specialized application for mastering vim | |
| " There are two queues, Study and Known. Depending how confident you feel | |
| " about the item you are currently learning, you can move it down several | |
| " positions, all the way to the end of the Study queue, or to the Known | |
| " queue. | |
| " type ,, (that's comma comma) |
| require "awesome_print" | |
| module XmlParsing | |
| require "ox" | |
| class Reader < ::Ox::Sax | |
| def initialize file_path, target, target_handler | |
| @target_handler = target_handler | |
| @target = target | |
| @file_path = file_path |
| -- Two dashes start a one-line comment. | |
| --[[ | |
| Adding two ['s and ]'s makes it a | |
| multi-line comment. | |
| --]] | |
| ---------------------------------------------------- | |
| -- 1. Variables and flow control. | |
| ---------------------------------------------------- |
The question: how can we use ES6 modules in Node.js, where modules-as-functions is very common? That is, given a future in which V8 supports ES6 modules:
export syntax, without breaking consumers that do require("function-module")()?import syntax, while not demanding that the module author rewrites his code to ES6 export?@wycats showed me a solution. It involves hooking into the loader API to do some rewriting, and using a distinguished name for the single export.
This is me eating crow for lots of false statements I've made all over Twitter today. Here it goes.
| # Tested in Ruby 1.8.7 | |
| class ParentClass | |
| def call_private_good | |
| # Private methods can only be called without an explicit receiver | |
| private_test | |
| end | |
| def call_private_bad | |
| # Calling a private method with an explicit receiver (self) will fail |