Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct
any: magic, ill-behaved type that acts like a combination ofnever(the proper [bottom type]) andunknown(the proper [top type])- Anything except
neveris assignable toany, andanyis assignable to anything at all. - Identities:
any & AnyTypeExpression = any,any | AnyTypeExpression = any - Key TypeScript feature that allows for [gradual typing].
- Anything except
unknown: proper, well-behaved [top type]- Anything at all is assignable to
unknown.unknownis only assignable to itself (unknown) andany. - Identities:
unknown & AnyTypeExpression = AnyTypeExpression,unknown | AnyTypeExpression = unknown
- Anything at all is assignable to
- Prefer over
anywhenever possible. Anywhere in well-typed code you're tempted to useany, you probably wantunknown.
| # ------------------------------------------------ | |
| # Config files are located in /etc/wireguard/wg0 | |
| # ------------------------------------------------ | |
| # ---------- Server Config ---------- | |
| [Interface] | |
| Address = 10.10.0.1/24 # IPV4 CIDR | |
| Address = fd86:ea04:1111::1/64 # IPV6 CIDR | |
| PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # Add forwarding when VPN is started | |
| PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE # Remove forwarding when VPN is shutdown |
| defmodule SqlParser do | |
| def run() do | |
| input = "select col1 from ( | |
| select col2, col3 from ( | |
| select col4, col5, col6 from some_table | |
| ) | |
| ) | |
| " | |
| IO.puts("input: #{inspect(input)}\n") | |
| IO.inspect(parse(input)) |
This is an example of a function whose logic lives in the type definition rather than in the function body.
/**
* @name `curryRecord`
*
* Takes a unary function that takes a record as an argument, and makes the
* record partially applicable. Returns a new function that takes a partial ofThis is a quick sketch of how I think terminology applies to the various kinds of mocking and test doubles that apply in Go.
In practice, the most effective way to mock things in Go is to use an interface, and then to substitute a specialized testing implementation in place of a real one. Wherever a substitute is used, I think this should be called a "double".
There is one specialization of a "double" and that is a "fake" implementation. Fakes can often have real world uses, e.g: "RamDiskDatabase", but are typically
NOTE: The Tree-sitter API and documentation has changed and improved since this guide was created. I can't guarantee this is up to date.
Tree-sitter is the new way Atom is providing language recognition features, such as syntax highlighting, code folding, autocomplete, and more. In contrast to TextMate grammars, which work by regex matching, Tree-sitter will generate an entire syntax tree. But more on that can be found in it's own docs.
Here, we look at making one from scratch.
| # One liner | |
| wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
| # Explained | |
| wget \ | |
| --recursive \ # Download the whole site. | |
| --page-requisites \ # Get all assets/elements (CSS/JS/images). | |
| --adjust-extension \ # Save files with .html on the end. | |
| --span-hosts \ # Include necessary assets from offsite as well. | |
| --convert-links \ # Update links to still work in the static version. |
| /* | |
| * client.c | |
| * | |
| * Simple FTP Client | |
| * ==================== | |
| * Connects the server, and sends a command "Get FILENAME" to retrieve | |
| * the file. If the file exists on the server, client retrieves it. | |
| * | |
| * Compile & link : gcc client.c -o client | |
| * Execute : ./client |
####Rets Rabbit http://www.retsrabbit.com
Rets Rabbit removes the nightmare of importing thousands of real estate listings and photos from RETS or ListHub and gives you an easy to use import and Web API server so you can focus on building your listing search powered website or app.
