(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.
| class Rover | |
| class InvalidDirection < StandardError | |
| def message | |
| 'Vertigoooooo!' | |
| end | |
| end | |
| VALID_DIRECTIONS = %i(north south east west).freeze | |
| attr_accessor :ns_coordinates, :ew_coordinates, :direction |
| class Cache | |
| attr_accessor :data | |
| def initialize(data: {}) | |
| @data = data | |
| end | |
| def get(key) | |
| return if data.fetch(key, {}).fetch(:expires_at, nil) <= now |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> | |
| <script> | |
| $(function() { | |
| $(".video").click(function () { | |
| var theModal = $(this).data("target"), | |
| videoSRC = $(this).attr("data-video"), |
(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.
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
| server { | |
| listen 80; | |
| server_name localhost; | |
| root /usr/share/nginx/html; | |
| location / { | |
| expires 5m; | |
| try_files $uri $uri/ /index.html; | |
| } |
| // Copyright (c) 2012 Sutoiku, Inc. (MIT License) | |
| function PV(rate, periods, payment, future, type) { | |
| // Initialize type | |
| var type = (typeof type === 'undefined') ? 0 : type; | |
| // Evaluate rate and periods (TODO: replace with secure expression evaluator) | |
| rate = eval(rate); | |
| periods = eval(periods); |
| # p_map is a parallel map which runs each and every process concurrently | |
| > p_map = fn -> 1..5 |> Enum.map(fn(i) -> Task.async(fn -> :timer.sleep(200); i + 1 end) end) |> Enum.map(fn(tsk) -> Task.await(tsk) end) end | |
| # slow_map runs each and every iteration one after the other | |
| > slow_map = fn -> 1..5 |> Enum.map(fn(i) -> :timer.sleep(200); i + 1 end) end | |
| > :timer.tc(fn -> p_map.() end, []) | |
| {200830, [2, 3, 4, 5, 6]} | |
| > :timer.tc(fn -> slow_map.() end, []) |
| /** | |
| * @OnlyCurrentDoc Limits the script to only accessing the current spreadsheet. | |
| */ | |
| /** | |
| * Adds a custom menu with items to show the sidebar and dialog. | |
| * | |
| * @param {Object} e The event parameter for a simple onOpen trigger. | |
| */ |
| // swap the keybindings for paste and paste_and_indent | |
| { "keys": ["super+v"], "command": "paste_and_indent" }, | |
| { "keys": ["super+shift+v"], "command": "paste" } |